You need to sign in to do that
Don't have an account?
test coverage
As I am new to Apex and salesforce, someone told me that I need to write test class for each class that I have written and test them.
If I don't have test class, I can't move to production.
Is that correct?
Why do I need to write test class for each class I have written? Actually, sometimes it is so troublesome as I need to write even a new class to call to external end point. Even though my actual method has been working and already tested to call to end point, when I wirte test calss, it won't allow me to call http method directly and need to even create new class as Mock.
As someone scaring me , if I don't finish test class, I can't move my code to production.
Any helpful link or useful explanation will be so much appreaciated.
beside having something to validate your work it gives you a better understanding of what you have done and will be used as a backward compatibility tests for future development - a very good thing to have.
Also, please go through the links a bove posted by asish1989
All Answers
Go through these link
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_test.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_best_practices.htm
beside having something to validate your work it gives you a better understanding of what you have done and will be used as a backward compatibility tests for future development - a very good thing to have.
Also, please go through the links a bove posted by asish1989