Created
June 26, 2013 01:19
-
-
Save mxalix258/5863979 to your computer and use it in GitHub Desktop.
Method for testing a visualforce extension and controller methods.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest | |
//class name | |
private class vacationdaysTEST{ | |
//test method | |
private static testMethod void vacationdaysTEST(){ | |
//instantiate the object on which the extension is defined. | |
Leave_Request__c lr = new Leave_Request__c(); | |
//instantiate standardcontroller, pass object variable into constructor | |
ApexPages.StandardController sc = new ApexPages.StandardController(lr); | |
//instantiate extension controller, pass standard controller variable into constructor | |
vacationdays controller = new vacationdays(sc); | |
//executes method within the controller extension | |
controller.getUserInfo(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment