You will run into one of the following situation commenly.
1) Have a trigger which doesn't do anything (No code inside, and no helper class call etc.) - You still need a 1% of code coverage in order to deploy this trigger. Why not 75%? Because you may have 100 other individual triggers which are deployed in past with 100% code coverage for each and so it allows you to have 1% for this new trigger. Because your average is being taken cared, which is 75%
2) You have a Trigger which has a helper class and this is the first trigger you are deploying - In this case you need to have 75% (at least) code coverage prior to deploy.
3) You have a trigger which doesn't have helper class but all the code is within inside the trigger - In this case you need to have 75% (at least) code coverage prior to deploy.
I agree with the people above for 1% minimum. But that only comes into picture when you have other triggers deployed with an average of way more than 75% of coverage.
If you don't have any trigger on any object then you don't require any test class on that object. If you have a Trigger but there is not any helper class or method then you have to write a test class with minimum 1% code coverage.
You have to get at least 1% Code Coverage to deploy your code to the production.
Every trigger must have some test coverage. Triggers are the only logical blocks that specifically require >0% coverage.
Kindly mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
You will run into one of the following situation commenly.
1) Have a trigger which doesn't do anything (No code inside, and no helper class call etc.) - You still need a 1% of code coverage in order to deploy this trigger. Why not 75%? Because you may have 100 other individual triggers which are deployed in past with 100% code coverage for each and so it allows you to have 1% for this new trigger. Because your average is being taken cared, which is 75%
2) You have a Trigger which has a helper class and this is the first trigger you are deploying - In this case you need to have 75% (at least) code coverage prior to deploy.
3) You have a trigger which doesn't have helper class but all the code is within inside the trigger - In this case you need to have 75% (at least) code coverage prior to deploy.
I agree with the people above for 1% minimum. But that only comes into picture when you have other triggers deployed with an average of way more than 75% of coverage.
1) Have a trigger which doesn't do anything (No code inside, and no helper class call etc.)
- You still need a 1% of code coverage in order to deploy this trigger. Why not 75%? Because you may have 100 other individual triggers which are deployed in past with 100% code coverage for each and so it allows you to have 1% for this new trigger. Because your average is being taken cared, which is 75%
2) You have a Trigger which has a helper class and this is the first trigger you are deploying
- In this case you need to have 75% (at least) code coverage prior to deploy.
3) You have a trigger which doesn't have helper class but all the code is within inside the trigger
- In this case you need to have 75% (at least) code coverage prior to deploy.
I agree with the people above for 1% minimum. But that only comes into picture when you have other triggers deployed with an average of way more than 75% of coverage.
Hope it helps!
All Answers
Please choose best answer if you help it.
You have to get at least 1% Code Coverage to deploy your code to the production.
Every trigger must have some test coverage.
Triggers are the only logical blocks that specifically require >0% coverage.
Kindly mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Regards
Suraj
1) Have a trigger which doesn't do anything (No code inside, and no helper class call etc.)
- You still need a 1% of code coverage in order to deploy this trigger. Why not 75%? Because you may have 100 other individual triggers which are deployed in past with 100% code coverage for each and so it allows you to have 1% for this new trigger. Because your average is being taken cared, which is 75%
2) You have a Trigger which has a helper class and this is the first trigger you are deploying
- In this case you need to have 75% (at least) code coverage prior to deploy.
3) You have a trigger which doesn't have helper class but all the code is within inside the trigger
- In this case you need to have 75% (at least) code coverage prior to deploy.
I agree with the people above for 1% minimum. But that only comes into picture when you have other triggers deployed with an average of way more than 75% of coverage.
Hope it helps!