Report when an abstract class declares a member marked with [ClassCleanup] without specifying the inheritance behavior.
Background and Motivation
When an abstract class is declaring a [ClassCleanup] member without specifying the inheritance behavior, then this member will simply be ignored so we should flag the case.
Proposed Feature
Scenarios to flag:
[TestClass]
public abstract class BaseClass
{
[ClassCleanup]
public static void ClassCleanup()
{
}
}
public abstract class BaseClass
{
[ClassCleanup]
public static void ClassCleanup()
{
}
}
Valid scenario:
[TestClass]
public abstract class BaseClass
{
[ClassCleanup(Microsoft.VisualStudio.TestTools.UnitTesting.InheritanceBehavior.BeforeEachDerivedClass)]
public static void ClassCleanup()
{
}
}
or
public abstract class BaseClass
{
[ClassCleanup(Microsoft.VisualStudio.TestTools.UnitTesting.InheritanceBehavior.BeforeEachDerivedClass)]
public static void ClassCleanup()
{
}
}
Summary
Report when an
abstract
class declares a member marked with[ClassCleanup]
without specifying the inheritance behavior.Background and Motivation
When an
abstract
class is declaring a[ClassCleanup]
member without specifying the inheritance behavior, then this member will simply be ignored so we should flag the case.Proposed Feature
Scenarios to flag:
Valid scenario:
or