Activity Forums Salesforce® Discussions What are the best approaches to write a test class in salesforce?

  • Kirandeep

    Member
    June 25, 2020 at 2:39 pm

    Best Practices to write test Class :-
    -Do not put (seeAllData = true) in test class otherwise, use it for exceptional cases.
    -Use @isTest at the Top for all the test classes.
    -Test in bulk
    -System.runAs() method to test the functionality in user Context
    -Use Test.startTest() and Test.stopTest() statement to increase Governor Limits

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos