0 Comments

If you have one NUnit test project per Microsoft Visual Studio solution, to test all the projects (assemblies) in the solution, running NCover on the NUnit test assembly, all NUnit tests will be run and the coverage of all assemblies will be reported, when you are just interested in a specific assembly, you can let NCover run only specific NUnit tests.
This can be done in 2 ways:

– Specifying the namespace to test (in my case, preferable)
– Using the NUnit attribute [Category]

Specifying the namespace to test (in my case, preferable)

image 
In this way you don’t have to change you’re NUnit test code and because all NUnit tests of a specific assembly have a specific namespace, I can let NCover only run an report the coverage of a specific assemlby (subsystem).

Using the NUnit [Category] attibute
If you want to report the coverage of a specific group of NUnit tests, you can apply a category on the NUnit test in the group. NCover will only run and report the coverage of these NUnit tests.

        [Test]
        [Category("MyCustomer.MyProduct.MySubsytem.MyCategory")]
        public void TestForASpecificFunctionInASpecificAssemlby()
        {

        }

In NCover you can report the coverage of this specific NUnit tests category by using the values:

 image

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts