Code Coverage Testing – Visual Studio 2010 – Link

Posted: July 14, 2011 in QA, VS 2010
Tags: , , ,

Below link has interesting article about code coverage testing using Visual Studio 2010.

http://www.buffington.com/Blog/post/2010/04/27/Visual-Studio-2010-Code-Coverage-Testing-in-10-Easy-Steps.aspx

You may not see result if you exactly follow those steps. In Step 4 don’t change selection to Trace and Test Impact. It should have Local selection as Code Coverage settings were asked to do on Local.testsettings file.

You can also use Test menu -> Test View option to run the tests.

If you are writing an API then you will have class library type projects (.dll output). You can quickly create test methods for your API methods by automatically generating the Unit Tests using “Create Unit Tests …” which you can see when you right click on any method. This will ask you to create Test Project and just follow the steps that it asks. Once Test methods are created you can comment out Assert.Inconclusive line in all test methods and provide proper input/expected variable values before running the Tests.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s