The test code is used to pragmatically test your code and ensure that everything is working fine as expected.
Mostly it is used for deployment(pushing code from one org to another, developer or sandbox to production). These test classes runs automatically each time you deploy your code, if they fail then it means something in your code is not working or need to be corrected.
Test classes - simply tests whether your code will work in destination org or not(It will let you know the status before actually pushing your code).
The test code is used to pragmatically test your code and ensure that everything is working fine as expected.
Mostly it is used for deployment(pushing code from one org to another, developer or sandbox to production). These test classes runs automatically each time you deploy your code, if they fail then it means something in your code is not working or need to be corrected.
Test classes - simply tests whether your code will work in destination org or not(It will let you know the status before actually pushing your code).
thnx Rahul for giving your time .. the problem i am facing is i am not able to write test code for my code... i have problem regarding passing the fake data into the test code.. any suggestion regarding it???
It is very simple. You are suppose to create an instance of the object. The enter in all the required fields for that object. Last step is to insert it.
The test code is used to pragmatically test your code and ensure that everything is working fine as expected.
Mostly it is used for deployment(pushing code from one org to another, developer or sandbox to production).
These test classes runs automatically each time you deploy your code, if they fail then it means something in your code is not working or need to be corrected.
Test classes - simply tests whether your code will work in destination org or not(It will let you know the status before actually pushing your code).
Refer this document for more detail.
All Answers
The test code is used to pragmatically test your code and ensure that everything is working fine as expected.
Mostly it is used for deployment(pushing code from one org to another, developer or sandbox to production).
These test classes runs automatically each time you deploy your code, if they fail then it means something in your code is not working or need to be corrected.
Test classes - simply tests whether your code will work in destination org or not(It will let you know the status before actually pushing your code).
Refer this document for more detail.
thnx Rahul for giving your time .. the problem i am facing is i am not able to write test code for my code... i have problem regarding passing the fake data into the test code.. any suggestion regarding it???
Hi,
It is very simple. You are suppose to create an instance of the object. The enter in all the required fields for that object. Last step is to insert it.
Follow this link http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_example.htm
Regards,