← Back to team overview

nunit-core team mailing list archive

[Bug 487878] [NEW] Tests in generic class without proper TestFixture attribute should be reported as invalid

 

Public bug reported:

There are two cases that NUnit should report invalid tests but it
doesn't:

1) without TestFixtureAttribute
     // forgot [TestFixture(typeof(string))]
     public class GenericTestFixture<T>
     {
         [Test] public void TestOnGenericFixture() {}
     }

2) with inherited TestFixtureAttribute but no type paramter.

     [TestFixture]
     public class ThirdPartyFixture
     {
     }
 
     // forgot [TestFixture(typeof(string))]
     public class GenericTestFixture<T> : ThirdPartyFixture
     {
         [Test] public void TestOnGenericFixture() {}
     }

See http://groups.google.com/group/nunit-discuss/msg/de708a9c9b0be103

** Affects: nunit-3.0
     Importance: Undecided
         Status: New

** Affects: nunitv2
     Importance: Undecided
         Status: New

** Also affects: nunit-3.0
   Importance: Undecided
       Status: New

-- 
Tests in generic class without proper TestFixture attribute should be reported as invalid
https://bugs.launchpad.net/bugs/487878
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.

Status in NUnit Test Framework: New
Status in NUnit V2 Test Framework: New

Bug description:
There are two cases that NUnit should report invalid tests but it doesn't:

1) without TestFixtureAttribute
     // forgot [TestFixture(typeof(string))]
     public class GenericTestFixture<T>
     {
         [Test] public void TestOnGenericFixture() {}
     }

2) with inherited TestFixtureAttribute but no type paramter.

     [TestFixture]
     public class ThirdPartyFixture
     {
     }
 
     // forgot [TestFixture(typeof(string))]
     public class GenericTestFixture<T> : ThirdPartyFixture
     {
         [Test] public void TestOnGenericFixture() {}
     }

See http://groups.google.com/group/nunit-discuss/msg/de708a9c9b0be103



Follow ups

References