Generic Test Instances disappear
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Fix Released
|
High
|
Charlie Poole | ||
NUnit V2 |
Fix Released
|
High
|
Charlie Poole |
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 TestFixtureAttr
For example, this fixture will only be instantiated once - using either the first or the last attribute depending on the runtime.
[TestFixture(
[TestFixture(
[TestFixture(
public class GenericFixture<T> { }
As a workaround, add a single argument to the fixture and all three instances will be created.
[TestFixture(
[TestFixture(
[TestFixture(
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.
Changed in nunitv2: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Charlie Poole (charlie.poole) |
Changed in nunit-3.0: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Charlie Poole (charlie.poole) |
Changed in nunitv2: | |
status: | Triaged → Fix Committed |
milestone: | none → 2.5.7 |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
Changed in nunit-3.0: | |
status: | Triaged → Fix Committed |
Changed in nunit-3.0: | |
milestone: | none → 2.9.6 |
tags: | added: framework |
Changed in nunit-3.0: | |
status: | Fix Committed → Fix Released |