Create and Execute a Test Suite in Salesforce
A test suite is a collection of Apex test classes that you run together. For example, create a suite of tests that you run every time you prepare for a ....
A test suite is a collection of Apex test classes that you run together. For example, create a suite of tests that you run every time you prepare for a ....
Test.isRunningTest() can be used to check whether the code is executed by test class. Sample Code: if ( !Test.isRunningTest() ) { /*Code Block which won't execute during Test Class ....
Sample Code: Apex Class: public class EmployeeController { public static void assignSequence(List<Employee__c> listEmployee, Decimal startNum) { Decimal initial = startNum; List<EmployeeWrapper> listEmployeeWrapper = new List<EmployeeWrapper>(); for(Employee__c emp : listEmployee) { ....
Abstract Class: public abstract class SampleAbstract { public Task newTask; public void createT(Id caseId, Id accountId) { newTask = new Task(); ....
Asserts that the first two arguments are the same. If they are not, a fatal error is returned that causes code execution to halt. Sample Code: Trigger: trigger AccountTrigger on ....
Sample Code: Trigger: trigger AccountTrigger on Account ( before insert ) { for ( Account acct : trigger.new ) { if ( acct.Name == 'Test Account' ) acct.Description = 'Test'; ....