views:

2216

answers:

3

Is there a way to test code coverage within visual studio if I'm using MSTest? Or do I have to buy NCover?

Is the NCover Enterprise worth the money or are the old betas good enough if Microsoft doesn't provide built in tools to do code coverage?

EDIT: Description of VS Products and which ones include code coverage http://www.microsoft.com/visualstudio/en-us/products/teamsystem/default.mspx

TestDriven.NET (http://testdriven.net/) can be used if your VS version doesn't support it.

+3  A: 

Yes, you can find code coverage information from within Visual Studio, provided that you have a version of Visual Studio that provides that functionality, such as the Team System. When setting up the unit tests in VS.NET, a localtestrun.testrunconfig file will be created and added as part of the solution. Double-click this file and find the option Code Coverage option on the left of the dialog. Select the assemblies for which you want to collect code coverage information and then re-run the unit tests. Code coverage information will be collected and is available. To get the code coverage information open the test results window and click on the code coverage results button, which will open an alternative window with the results.

sduplooy
I believe it is also available in VS Pro.
Brian Rasmussen
Andreas Huber
@Andreas: My bad, thanks for the update.
Brian Rasmussen
+7  A: 
Marc Gravell
A: 

@Marc gravell, rightly said image says a thousand words, that for the info, got configure MSTEST with TD.NET and working fine. Thanks so much.