How to ignore generated code from code coverage data

后端 未结 4 1438
说谎
说谎 2020-12-16 13:00

I am using Visual Studio 2010 and would like to exclude the generated service reference code from my code coverage statistics.

I found an article pre 2010 that ment

4条回答
  •  太阳男子
    2020-12-16 13:22

    System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage can be used on top of the class. This is a poor option since you need to redo this anytime you regenerate your code. Maybe Microsoft could do this for us automagically when creating service references, entity framework types, etc...

提交回复
热议问题