Exclude auto properties from Code Coverage in Visual Studio 2015

后端 未结 3 1008
没有蜡笔的小新
没有蜡笔的小新 2020-12-06 06:38

I just upgraded a bunch of projects to VS2015/C#6.

Now MSTest\'s Code Coverage analysis is reporting that some auto properties aren\'t covered by unit tests. This wa

3条回答
  •  难免孤独
    2020-12-06 07:18

    I think [ExcludeFromCodeCoverage] is your only option. It is just a one-time thing you are going to have to do. I, personally, DO write unit tests on the property getter/setters, especially ones such as in WPF, where I want to be sure the property change notifications occur.

提交回复
热议问题