function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ravi23Ravi23 

My Test Class is passing but however the code coverage is 0%

Hi All,

          Two of my test classes are passing without any issues but the code coverage on the respective classes is 0% . Can anyone let me know what the possible issue might have been?
Best Answer chosen by Ravi23
Prasad Avala(SFDC)Prasad Avala(SFDC)
Hi Ravi,
From winter 16, there were few changes made for test coverage.

Please check the below link for more details:

https://success.salesforce.com/issues_view?id=a1p30000000eMoyAAE


 

All Answers

pbattissonpbattisson
Ravi

Can you post up one of the test classes so we can review.

Are you referring to the test class itself having 0% coverage? If so then this is correct. As you can see in the knowledge article here (https://help.salesforce.com/apex/HTViewSolution?urlname=Why-is-a-Test-class-evaluated-as-part-of-the-Organization-s-Code-Coverage&language=en_US) any classes marked with @isTest will not be included in code coverage calculations. 

"All @isTest annotated test classes that only contain test methods should have NumLinesCovered and NumLinesUncovered = null."

Paul
Prasad Avala(SFDC)Prasad Avala(SFDC)
Hi Ravi,
From winter 16, there were few changes made for test coverage.

Please check the below link for more details:

https://success.salesforce.com/issues_view?id=a1p30000000eMoyAAE


 
This was selected as the best answer
Ravi23Ravi23
Thanks Prasad for the post it is really helpful and resolved my issue.