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

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

  •  12-12-2019
  •  | 
  •  

Domanda

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 ?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top