+ Start a Discussion
PS81PS81 

Question on Apex test class and methods - new starter

Hi

We are gonna to move set of developments to production org but now have a question with regards to deployment. I read in one of the doc that we cant deploy the code in prod org if the code test coverage is atleast 75%. I must say that i have not written test coverage code...so the question is :
1. how to do the test coverage code?
2. For instance i have a class called myClass and should I create a new class called myclasstest for test coverage? if yes how would the new class would know that the test case is for the intended class ?
Abu HashimAbu Hashim
@PS81,

Yes we need to write a test class that should compile all your written classes in ORG. If you are a starter, please go through the below link.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_test.htm

Thanks,
Abu
PS81PS81
Thank for your thoughts...But how does the system recogonise the test class thatis created is for a particualr class?
Abu HashimAbu Hashim
While writing your test class, you need to refer/call the flow (calling those methods of the main class) with dummy test data.