NCover: Attribute-Based Type Exclusion, but the wrong way round…

With Version 1.5.2, NCover introduced a Attribute-Based Type Exclusion. It works, but not as I expected.

I normally use NCover together with my test code. When I have a class to test that throws an exception the test function is not covered completely.
Code Coverage without excluded Attribute
The function BarTest() is only covered to 67% as the end of the function is not executed because the Exception was thrown. I was waiting for the possibility to define that a function does not need to be covered with adding an attribute to the Function. But when I add an Attribute to the function and define this Attribute to be excluded (with //ea AttributeName), the Function is not covered.
Code Coverage with excluded Attribute
So instead of having a higher code coverage I have a lower code coverage. Not the result I was expecting from this feature.
But maybe this will change in the future. I keep watching…

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.