Monday, April 06, 2009

Enabling Code Coverage in VSTS Test Runs

To Enable Code Coverage in VSTS Unit Test runs go to menu Test->Edit Test Run Configurations. Select the configuration you want to edit. By default this is Local Test Run. Configuration window will open, displaying options for the default test run. Selecting Code Coverage in the window on the left will present the Code Coverage options. On the right-hand side, elect the checkbox next to the DLL you want to run code coverage on. Now, every time the Unit Tests are run, the Code Coverage will also run for the selected DLL.
Just note that Debugging a unit test, as opposed to Running it, will not include Code Coverage.

No comments: