TestFixture attributes on base classes are not ignored
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
NUnit V2 | Status tracked in Trunk | |||||
2.5 |
Fix Released
|
Medium
|
Charlie Poole | |||
Trunk |
Fix Released
|
Medium
|
Charlie Poole |
Bug Description
Using Nunit 2.5.9 GUI Runner & 2.5.9 framework.
TestFixutre attributes on derived classes should replace any declared on superclasses, which is what is described in the documentation:
http://
-------
Inheritance
The TestFixtureAttr
In order to facilitate use of generic and/or parameterized classes, where the derived class may require a different number of arguments (or type arguments) from the base class, any TestFixture attribute on a derived class causes those on the base classes to be ignored.
-------
However this isn't happening as the following test case shows.
Reproducible Test Case:
-------
[TestFixtur
public abstract class AbstractBase<T>
{
[Test]
public void TestMethod()
{
}
}
[TestFixtur
public class ConcreteClass<T> : AbstractBase<T>
{
}
public class TagClassDefault
{
}
public class TagClassCustom
{
}
-------
Expected Behaviour:
ConcreteClass is constructed with the TagClassCustom type parameter only
Actual Behaviour:
ConcreateClass is constructed twice, once with TagClassCustom, the other with TagClassDefault
description: | updated |
Changed in nunitv2: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in nunitv2: | |
milestone: | none → 2.5.10 |
NOTE: Nunit 2.5.5 acts as expected