+ Start a Discussion
Nagarjun TNagarjun T 

How write the Test class for Account of detail page in salesforce

Best Answer chosen by Nagarjun T
Amit Chaudhary 8Amit Chaudhary 8
Hi Nagarjun,

I will recommend you to start using trailhead to learn about test classes
1) https://trailhead.salesforce.com/modules/apex_testing

Pleasse check below post sample test class
1) http://amitsalesforce.blogspot.com/2015/06/best-practice-for-test-classes-sample.html

Also please check below post
1) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_test.htm
2) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_example.htm


You write a test class for this the same way that you would any other:
- Set up some data for the controller to access (Account, Contact etc)
- Execute a method/methods:-
- Verify the behaviour with asserts.

Let us know if this will help you
 

All Answers

Nagarjun TNagarjun T
https://developer.salesforce.com/forums/?id=9060G000000Bj8MQAS
Amit Chaudhary 8Amit Chaudhary 8
Hi Nagarjun,

I will recommend you to start using trailhead to learn about test classes
1) https://trailhead.salesforce.com/modules/apex_testing

Pleasse check below post sample test class
1) http://amitsalesforce.blogspot.com/2015/06/best-practice-for-test-classes-sample.html

Also please check below post
1) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_test.htm
2) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_example.htm


You write a test class for this the same way that you would any other:
- Set up some data for the controller to access (Account, Contact etc)
- Execute a method/methods:-
- Verify the behaviour with asserts.

Let us know if this will help you
 
This was selected as the best answer