Activity Forums Salesforce® Discussions What are the best practices to write a test class?

  • Aditya

    Member
    March 5, 2020 at 3:30 pm

    Salesforce Apex Test Class Best Practices
    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: Test to see if your code can run on 200 records at once.
    Avoid Using Hard Coding Ids anywhere in test Class or any apex class

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos