Tuesday, 11 December 2012

Steps for code Coverage in VS2010

I was struggling to setup the code coverage in Visual Studio 2010. After that I found is so simple as the below steps.

Steps for code Coverage in VS2010

1.       Enable Code Coverage à
i.                     Double click on Local.testsettings file under Solution Explorer. Test settings window will be opened.
ii.                   Select “Data and Diagnostics” from left pane.
iii.                  Check “Code Coverage” checkbox.
               


iv.                 Click on “Advanced…” button for Code coverage to set the assembly (dll).
v.                   Mark checkboxes of assemblies for those code coverage reports is required. Apply settings.    
2.       Run Code Coverage à

i.                     From Visual Studio set the active test setting using Test => Active Test Setting => Local(select Local as default setting)
ii.                   Run Visual Studio run tests. Select Test => Run => Tests in Current Context from menu.
iii.                  When tests are run you can open code coverage results by selecting Test => Windows => Code Coverage Results from menu.

Code coverage results will look like à


No comments:

Post a Comment