All my apex classes have more than 90% code coverage. But, when I am trying to deploy them, it is showing I have 59% code coverage. How to solve this issue.
I have run all test, & check all apex classes which I am trying to deploy. All those have >90% code coverage. If code coverage = average of all individual coverage, my code coverage is supposed to be about 90% but it is showing 59% only.
SeeAllData
totrue
. Also, don't puttry catch
in your tests. Maybe an error is raised but you can't see it on deployment.