This file contains 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
/** | |
* This class contains unit tests for validating the behavior of Apex classes | |
* and triggers. | |
* | |
* Unit tests are class methods that verify whether a particular piece | |
* of code is working properly. Unit test methods take no arguments, | |
* commit no data to the database, and are flagged with the testMethod | |
* keyword in the method definition. | |
* | |
* All test methods in an organization are executed whenever Apex code is deployed |
This file contains 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
Public class myClass{ | |
Public string myMethod(Boolean bool){ | |
string returnString = ''; //declare return var | |
if(bool == null){ //check for null, not likely but could happen | |
returnString = 'You passed in a null Boolean! Stop the insanity!'; //alter return string if bool is null | |
} else if(bool == true){ //check for TRUE | |
returnString = 'You passed in TRUE'; //alter return string if bool is TRUE | |
} else if(bool == false){ //check for FALSE | |
returnString = 'You passed in FALSE'; //alter return string if bool is FALSE | |
} |