Skip to main content
2 of 3
edited tags
mostwanted
  • 1.7k
  • 3
  • 15
  • 21

How to reach 100% Code Coverage when not testing protected methods

Does this make sense:

As we generally only want to test the API (of a class) and not the implementation details we generally do not need/want to test protected methods. As we do not want code coverage to drop just because we do not test implementation details we should use the @codeCoverageIgnore annotation for those protected methods.

Without @codeCoverageIgnore With @codeCoverageIgnore

mostwanted
  • 1.7k
  • 3
  • 15
  • 21