It is used for unit testing your code.It will strat with @is test annotation.See this link https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_test.htm
A test class is an apex class that tests your logic written in either apex class or trigger programatcally. A test class actually ensurs that your code is working fine as expected.
this is an important thing when you are doing deployment in production as salesforce allows deployment only when your 75% of the code is covered through test classes.
Please visit the link below to understand : - When to write Apex Test Class ? - Which factors to be tested while writing Test class ? - How to use @isTest Annotation in salesforce ? - How to write apex Test Class ?
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_test.htm
Please follow these links for test class basics
http://abhithetechknight.blogspot.in/2013/10/salesforce-test-class-basics.html
http://simplyforce.blogspot.in/2013/06/test-methods-what-why-and-how.html
Regards
Subhash
Check the below links to get more detail on this.
https://developer.salesforce.com/page/An_Introduction_to_Apex_Code_Test_Methods
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_best_practices.htm
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_example.htm
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_annotation_isTest.htm
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_unit_tests_running.htm
You can utilize the below site to understand what is test class and how to write?
http://salesforcekings.blogspot.in/2014/04/best-example-for-apex-test-class-in.html
A test class is an apex class that tests your logic written in either apex class or trigger programatcally. A test class actually ensurs that your code is working fine as expected.
this is an important thing when you are doing deployment in production as salesforce allows deployment only when your 75% of the code is covered through test classes.
thanks,
http://www.forcexplore.com/2014/07/wrapper-class-in-salesforce.html
Please visit the link below to understand :
- When to write Apex Test Class ?
- Which factors to be tested while writing Test class ?
- How to use @isTest Annotation in salesforce ?
- How to write apex Test Class ?
https://www.salesforcekid.com/2019/09/how-to-write-test-class-basics-salesforce.html
I hope this will help you to learn how to write a test class very easily
Thanks 😊,
AJINKYA DHAS
[SalesforceKid (http://www.salesforcekid.com)]