mock object coverage

mock object coverage

I'm using NMock in my unit tests. The object I'm mocking has a number of methods that are marked as virtual and never get called because the nmock framework overrides these objects during the unit tests. However, my mock object is still being checked for test coverage and it's coming back with 5% coverage and bringing down the average of the rest of my suite.

Is there a way to ignore certain classes like these mock objects during the coverage tests so they don't affect the rest of the testing?

Stan Rawrysz


RE: mock object coverage

Has this been resolved. I have a similar issue.

Deepa


RE: mock object coverage

NCover 3 includes type exclusions, which should take care of excluding those items. You can read more about type exclusions at http://docs.ncover.com/ref/3-0/ncover-console/command-line/profiling-options#et.