Does VS2010 Code Coverage support nUnit?

后端 未结 9 1968
情深已故
情深已故 2020-12-25 12:35

According to this schema VS2010 Premium and Ultimate has a tool for checking Code Coverage - together with a few other testing tools. Does this support nUnit too, or just MS

9条回答
  •  悲哀的现实
    2020-12-25 13:26

    I had the same problem and I found out a way to solve it. The project dll shown in "Code Coverage Detail" dialog is the wrong assembly to be instrumented and that's way is giving empty results. So you need to actually get that dll from another folder, it's in the unit test project folder! Since you added as a reference to your unit test project it will be there. So, for example, in my case I created a simple project calced Calculator and then created a unit test project called TestCalculator and added Calculator.dll as a reference in the unit test project. So in the "Code Coverage Detail" dialog I click on "Add Assembly" and I select Calculator.dll from the "..\TestCalculator\bin\Debug" folder. In that way it will work.

提交回复
热议问题