← Back to team overview

nunit-core team mailing list archive

[Bug 548841] Re: [Explicit] does not get overridden if there is another category exclude

 

Then there is still a bug left, since running my test case above
(leaving away the [Explicit] attribute) with "/include=T /exclude=B"
still executes TestA(), which should be (according your statement) only
be marked with category name "A", but not with category name "T".

Personally, I think that this overriding-instead-of-inheriting strategy
of category names is bad behavior and very unintuitive. With assigning
category names you make statements about individual aspects of a
test/test fixture. These statements are normally not exclusive. (For
example: "This fixture needs external hardware", "This test is very time
consuming", "This is an entry-level test", ...). On the other hand, you
can of course always argue with splitting up the fixture into several
smaller ones and into different assemblies.

-- 
[Explicit] does not get overridden if there is another category exclude
https://bugs.launchpad.net/bugs/548841
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.

Status in NUnit V2 Test Framework: Triaged

Bug description:
Steps to reproduce:
   - Test code below ([1])
   - nunit-console.exe <assemby.dll> /include=T /exclude=B"

Expected result:
   - TestA() is executed

Actual result:
   - No test is executed

Remarks
   - Everything works as expected, if you remove the [Expected] attribute


[1] Test case

    [TestFixture, Explicit, Category("T")]
    public class Test
    {
        [Test, Category("A")]
        public void TestA() { Console.WriteLine("-A-"); }
        [Test, Category("B")]
        public void TestB() { Console.WriteLine("-B-"); }
    }





References