← Back to team overview

nunit-core team mailing list archive

[Bug 611938] Re: Generic Test Instances disappear

 

** Changed in: nunit-3.0
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/611938

Title:
  Generic Test Instances disappear

Status in NUnit Test Framework:
  Fix Released
Status in NUnit V2 Test Framework:
  Fix Released

Bug description:
  NUnit 2.5.6 ignores all instances but one of a generic test fixture that uses a default constructor and has only Type args given
  on its TestFixtureAttribute. This is a serious bug since tests simply do not appear and are not run.

  For example, this fixture will only be instantiated once - using
  either the first or the last attribute depending on the runtime.

  [TestFixture(typeof(int)]
  [TestFixture(typeof(long)]
  [TestFixture(typeof(short)]
  public class GenericFixture<T> { }

  As a workaround, add a single argument to the fixture and all three
  instances will be created.

  [TestFixture(typeof(int), 42]
  [TestFixture(typeof(long), 42]
  [TestFixture(typeof(short), 42]
  public class GenericFixture<T> 
  {
     public GenericFixture(int theAnswer) { } 
  }

  Use of an argument forces the code into a different path that doesn't
  have the bug.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunit-3.0/+bug/611938/+subscriptions


References