How to avoid particular block of code to be avoided by test class in Salesforce?

Test.isRunningTest() is used to define whether the code is executed by test class.

Sample Code:

if ( !Test.isRunningTest() ) {
     /*Code Block which won't execute during Test Class Execution*/
}

No comments:

Post a Comment