Saturday, October 1, 2016

Running Code Coverage for Unit Tests in Visual Studio 2015

If you want to run Code Coverage for your Unit Tests, unfortunately, you will need to use Visual Studio 2015 Enterprise Edition.  Visual Studio 2015 Professional Edition still does not offer this crucial feature for most .NET Developers.

In any case, once you run the Unit Tests for your application from within Test Explorer, you can click on the "Run.." link to pull down the drop down menu options:

From there, you can select the option for "Analyze Code Coverage for All Tests", which will then present you with a "Code Coverage Results" pane:

Within the "Code Coverage Results" pane, you can further drill down into your individual namespaces and classes to determine how well your Unit Tests are covering your code!

No comments:

Post a Comment