Duplicate test using abstract test fixtures
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Fix Released
|
High
|
Charlie Poole | ||
NUnit V2 |
Fix Released
|
High
|
Charlie Poole |
Bug Description
Reported on nunit-discuss by Victor Kropp:
I've found bug in NUnit 2.5.5 with abstract TestFixtures.
Please find the sample in attached file.
You'll see DuplicateTest 2 times (actually, as much as marked abstract classes in hierarchy)
If non-abstract class is marked as TestFixture test appears only once.
This bug was introduced in version 2.5.3.
Code that reproduces this bug...
using NUnit.Framework;
namespace NUnitBug
{
[TestFixture]
public abstract class NUnitDuplicateT
{
}
[TestFixture]
public abstract class NUnitDuplicateT
{
}
public class NUnitDuplicateTests : NUnitDuplicateT
{
[Test]
public void DuplicateTest()
{
}
}
}
description: | updated |
Changed in nunitv2: | |
status: | New → In Progress |
importance: | Undecided → Low |
assignee: | nobody → Charlie Poole (charlie.poole) |
importance: | Low → Medium |
milestone: | none → 2.5.6 |
Changed in nunit-3.0: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in nunitv2: | |
importance: | Medium → High |
Changed in nunitv2: | |
status: | In Progress → Fix Committed |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
tags: | added: v2port |
Changed in nunit-3.0: | |
assignee: | nobody → Charlie Poole (charlie.poole) |
milestone: | none → 2.9.5 |
status: | Triaged → Fix Committed |
Changed in nunit-3.0: | |
status: | Fix Committed → Fix Released |
Yes, this is the result of a hack I put in to fix another bug - I feared it would
come back and bite me!
The root cause is that TestFixtureAttr ibute serves three different purposes:
1) To simpy mark a class as a fixture
2) To provide type arguments for a generic fixture
2) To provide actual arguments for constructing a parameterized fixture
It seemed like a nice idea at the time :-(