Posts Tagged: Code Coverage

How to exclude test assembly from code coverage in VS 2012

Posted by & filed under .Net, Code coverage, Visual Studio.

If you are using VS 2012, by default Code coverage results are available for Test assembly also. There is no direct way to disable this behavior, either you need to use the ExcludeFromCodeCoverage attribute or you need to use the runsettings file. The ExcludeFromCodeCoverage is pretty straight forward; you need to decorate all the unit [...]

How to enable code coverage in Visual Studio 2010

Posted by & filed under Visual Studio.

If you are writing frameworks and creating unit tests for the framework, you may require to find the code coverage of your code. And if you were using VS 2008 and moved to VS 2010, its slightly different. Open the local.testsettings which you can access from Test -> Edit Test Settings -> Local (local.testsettings) Select [...]