Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


C# NUnit Code Coverage

Posted on 2008-10-20
Medium Priority
Last Modified: 2013-12-17
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.
Question by:RishadanPort
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
LVL 16

Assisted Solution

CuteBug earned 500 total points
ID: 22763546
LVL 10

Expert Comment

ID: 22764465
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.

Good Luck!

Author Comment

ID: 22771100
Can these be used in with my NUnit tests? If so how?
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 10

Accepted Solution

oxyoo earned 1500 total points
ID: 22774182
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

Run NCover from Visual Studio (video)

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.

Author Comment

ID: 22815478
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.

Author Comment

ID: 22815609
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

Author Comment

ID: 22815877
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.

Author Closing Comment

ID: 31508093
Thanks a lot, works like a charm

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question