function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AlecSAlecS 

Test Code

I have written trigegrs in my sandbox environment.

 

I did not realize that I have to write test cases for these triggers until I started looking to move them to production.

 

What's the quickest way to learn how to write test cases for moving code to production.

 

Thank you.

 

 

Prafull G.Prafull G.
Rahul SharmaRahul Sharma
Basic Idea of Test class is to pragmatically test your code which would run and validate during deployment.
So firstly you need to create the test data according to your requirement.
For covering triggers, just the DML are enough; whereas for classes you need to invoke each method as you do it in page or order.

Look at the documentation for more examples.