Excluding source lines from coverage

Excluding source lines from coverage

I know with NCover I can exclude classes/methods/properties with attribute based exclusion. Is there a way to exclude lines from a method from coverage. I've used Clover(coverage tool for java), it's something like:

i++;
//CLOVER:OFF
j++;
//CLOVER:ON
k++;

in this case line j++ is excluded from coverage

Thanks!

Nathan


RE: Excluding source lines from coverage

Unfortunately, we don't have a feature like that in NCover at present. We don't parse source code, but instead process the actual assemblies as they're being executed, so we can't see comments at that point.

That said, it's something users have asked about and we're hoping to find a reasonable way to implement a feature like that in the future.

Thanks for the great suggestion!