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

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

  •  12-12-2019
  •  | 
  •  

質問

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 ?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top