August 19, 2014

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()) {
    ...................................
    ...................................
    ...................................
}

Cheers!!!

No comments:

Post a Comment