function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
goravksethgoravkseth 

Testing a simple controller extension on user object

I've got a very simple controller extension that powers an equally simply visualforce page that updates a few fields on the user object, but I have no idea how to go about testing it.  Tried a few different tests and still getting 0% coverage.  Any suggestions on which way to head would be most welcome.

 

public class UserControllerExtension {

private final User usr;

public UserControllerExtension(ApexPages.StandardController stdController) {
this.usr = (User)stdController.getRecord();

}

user u = [SELECT Id, Default_Department_Code__c, Default_Location_Code__c, Default_Funding_Source__c, Default_P_L_Code__c, Include_Opp_Amount_on_FL__c From USER Where Id =:UserInfo.GetuserId()];

public User getUser () {
return u;
}

public PageReference save() {
update u;
return null;
}

}