Issue
I have tried AndroidStudio's code coverage feature and I have met a strange issue:
It is marks the tested class's name as 'not covered' code. How is that possible? Is that a bug?
Picture here:
As you can see it has one method with 4 lines and each one of them is covered. So why is the red line at the class's name?
Solution
You are using a static
method, so the class
itself is never created as an object
, therefore never testing that ability.
Answered By - Stefan
Answer Checked By - Marilyn (JavaFixing Volunteer)