NCover coverage is lower because of no coverage of the models. Improving ncover coverage.

StackOverflow https://stackoverflow.com//questions/12695364

  •  12-12-2019
  •  | 
  •  

Question

Ncover coverage: There are classes in the project which are used like models(containing only properties). The code coverage for these is not there in the test cases. What is the general way of improving the coverage ?

Was it helpful?

Solution

If a class contains only properties (and I mean, truly properties, with only getters and setters that have no side effects), there is no need to test them. What would you test? There's nothing to do.

For that reason, there's no need to provide code coverage for them, and your code coverage is fine. I don't worry about code coverage for pure properties, or constructors that simply assign to pure properties. It's a waste of time.

Then again, that's my opinion. Your mileage may vary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top