I was trying this morning to run NCover (for the first time). I downloaded a eval copy (sweet!) and then opened NCover Explorer only to find myself a little lost. So I thought I'd RTFM a bit first. That helped (a little), and the documentation online also helped some, but what I really needed to do was check my MSTest test coverage of my base framework. The documentation really only covered generic scenarios and a little bit of googling only left me wanting. All these little bits and pieces, however, led me to make some educated guesses about what to put in the configuration for NCover and... success! So I thought I'd share, in case it helps someone else.

 

Open NCover Explorer.

Click on the "Run NCover" button on the toolbar or hit Ctrl+N [NOTE: Not the "Run NCover Now" button]

You should be presented with a configuration options screen (see Fig 1)

Set the "Path to application to profile" box to MSTest.exe file (Usually, C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe)

Set the "Working Folder" to the bin directory of your framework project: (Mine is: C:\svn\CodeBase\trunk\src\CodeBase\bin)

Set the "Application Arguments" to /noisolation /testcontainer:[test_project] where test_project is the path to the DLL of your test project (Mine looks like: /noisolation /testcontainer:C:\svn\CodeBase\trunk\src\CodeBase.Test\bin\Debug\CodeBase.Test.dll )

That's it!

You should now be able to click on the "Run [F5]" button at the bottom there and it will start the sample application, run the tests and give you a code coverage result that shows how much of your framework was exercised by your unit tests.

 

Hope this helps someone!

~L

 

[Fig 1]

NCoverOptions

posted on Thursday, May 15, 2008 1:47 PM | Filed Under [ TDD Learning Software ]

Comments

Gravatar
# re: NCover with MSTest
Posted by Robz
on 7/21/2008 8:38 PM
It's even better when you use TDD.Net (personal or commercial) and can do this right from the IDE. :D
Gravatar
# re: NCover with MSTest
Posted by Frank
on 9/1/2008 4:32 AM
Thanks for this, the /noisolation was what i was missing meaning all the code coverage results were greyed out.
Gravatar
# re: NCover with MSTest
Posted by Hants
on 9/6/2008 12:56 AM
Exactly helpful! Great work!
Gravatar
# re: NCover with MSTest
Posted by Jax
on 9/23/2008 6:31 AM
Aye it has, thankee! :)
Gravatar
# re: NCover with MSTest
Posted by Lee Brandt
on 9/23/2008 1:47 PM
I'm so glad you guys have found this helpful.

~Lee
Post Comment
Title *
Name *
Email
Url
Comment *  
Please add 7 and 5 and type the answer here: