Activity › Forums › Salesforce® Discussions › How do I write a good unit test in Salesforce? Salesforce® Discussions How do I write a good unit test in Salesforce? Posted by Ayush on May 8, 2020 at 2:33 PM How do I write a good unit test in Salesforce? Pooja replied 6 years ago 3 Members · 2 Replies 2 Replies Deepak Member May 8, 2020 at 4:31 PM A unit test should: Set up all conditions for testing. Call the method (or Trigger) being tested. Verify that the results are correct. Clean up modified records. [adinserter block='9'] Pooja Member May 11, 2020 at 5:49 AM *Set up all conditions for testing. *Call the method (or Trigger) being tested. *Verify that the results are correct. *Clean up modified records. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me