• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2738
  • Last Modified:

C# NUnit Code Coverage

I am using NUnit to test my C# code, and I was wondering how I could find out what code I have and have not tested.
0
RishadanPort
Asked:
RishadanPort
  • 5
  • 2
2 Solutions
 
CuteBugCommented:
0
 
oxyooCommented:
There is also this open source project, but I think that this has stopped being developed (Last Update: Jun 15 2004). I did use this project in my earlier projects and it worked fine, now I am using the version that CuteBug is referencing and it seems to have more features.

http://ncover.sourceforge.net/

Good Luck!
0
 
RishadanPortAuthor Commented:
Can these be used in with my NUnit tests? If so how?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
oxyooCommented:
Yes they can, and that's in my opinion the main purpose of NCover. Basically what I do is that I use CruiseControl.Net and have NAnt (MSBuild will work fine too) build scripts to compile project, run nunit tests, run ncover, etc and then display all the NCover results in the CC.Net dashboard. It takes some time to setup though, as CC.Net uses a lot of config files (TeamCity might be an easier approach with a nicer UI).

Integrating NCover results in CruiseControl.Net
http://www.ncover.com/documentation/howto/ccnetintegration

Run NCover from Visual Studio (video)
http://www.ncover.com/documentation/howto/run_ncover_from_vs


If you decide to go with commercial NCover, it will include a GUI application that will spit out all the NAnt, MSBuild, and even command line syntax to run NUnit and NCover together.

Hope that helps.
0
 
RishadanPortAuthor Commented:
Is there any chance somebody here could help me set it up the Graphical NCoverExplorer? I am having lots of problem setting it up because the documentation on the website is not great.
0
 
RishadanPortAuthor Commented:
I think I finally figured out how to do the command args properly... and it correctly shows which lines have been executed and which have not. Thanks a lot for the help
0
 
RishadanPortAuthor Commented:
What do these other tools, such as CruiseControl, NAnt ... specialize in that this NCover can't do? Looking at the interface, it did quite a good job finding which lines got executed and which didn't.
0
 
RishadanPortAuthor Commented:
Thanks a lot, works like a charm
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now