+ Start a Discussion
Sudipta SamalSudipta Samal 

what is test class please reply with example

Vidhyasagaran MuralidharanVidhyasagaran Muralidharan
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
Arunkumar RArunkumar R
Hi,

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
Cloud_forceCloud_force
Hi,

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
Ajinkya DhasAjinkya Dhas
Hi Sudipta,

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)]