Skip to main content
added 2 characters in body
Source Link
mostwanted
  • 1.7k
  • 3
  • 15
  • 21

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@codeCoverageIgnore annotation for those protected methods.

Without @codeCoverageIgnore With @codeCoverageIgnore

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

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

edited tags
Link
mostwanted
  • 1.7k
  • 3
  • 15
  • 21
Source Link
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