Code Coverage in Salesforce Testing
1. Go to Developer Console. 2. Go to Test --> New Run. 3. Select the Test class and click "Run" button to run the test. Cheers!!!
1. Go to Developer Console. 2. Go to Test --> New Run. 3. Select the Test class and click "Run" button to run the test. Cheers!!!
When testing your batch Apex, you can test only one execution of the execute method. You can use the scope parameter of the executeBatch method to limit the number of ....
Sample Test Class: @isTestprivate class testClass{ static testMethod void test() { Member__c m = new Member__c(); m.Name = 'Sample'; m.Email_Address__c = 'Your email address'; m.Age__c = 25; insert m; memberApproval.callApproval(m.Id); ....
To test static methods in Salesforce, we have to call the method along with the controller name, not with the object of the controller. Example: Apex Class: public class example ....
In test class and methods, we can access data in the organization. Prior to it we can just access test data. Using this we can access organization data. ....
To Run Unit test: To run unit testing, go to Setup Menu --> App Setup --> Develop --> Apex Test Execution and then select the Test Class and click ‘Run’ ....
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, send no ....
Unit testing: http://wiki.developerforce.com/page/An_Introduction_to_Apex_Code_Test_Methods http://wiki.developerforce.com/page/How_to_Write_Good_Unit_Tests http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_unit_tests.htm Testing Controllers and extensions: http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_error_handling.htm Running Unit Test Methods: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_unit_tests_running.htm Cheers!!!