Class TestFixtureAttribute
Marks the class as a TestFixture.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public class TestFixtureAttribute : NUnitAttribute, IFixtureBuilder2, IFixtureBuilder, ITestFixtureData, ITestData
- Inheritance
-
TestFixtureAttribute
- Implements
- Inherited Members
Constructors
TestFixtureAttribute()
Default constructor
public TestFixtureAttribute()
TestFixtureAttribute(params object?[]?)
Construct with a object[] representing a set of arguments. The arguments may later be separated into type arguments and constructor arguments.
public TestFixtureAttribute(params object?[]? arguments)
Parameters
arguments
object[]
Properties
Arguments
The arguments originally provided to the attribute
public object?[] Arguments { get; }
Property Value
- object[]
Author
The author of this fixture
public string? Author { get; set; }
Property Value
Category
Gets and sets the category for this fixture. May be a comma-separated list of categories.
public string? Category { get; set; }
Property Value
Description
Descriptive text for this fixture
public string? Description { get; set; }
Property Value
Explicit
Gets or sets a value indicating whether this TestFixtureAttribute is explicit.
public bool Explicit { get; set; }
Property Value
Ignore
Gets or sets the ignore reason. May set RunState as a side effect.
public string? Ignore { get; set; }
Property Value
- string
The ignore reason.
IgnoreReason
Gets or sets the ignore reason. When set to a non-null non-empty value, the test is marked as ignored.
public string? IgnoreReason { get; set; }
Property Value
- string
The ignore reason.
Properties
Properties pertaining to this fixture
public IPropertyBag Properties { get; }
Property Value
Reason
Gets or sets the reason for not running the fixture.
public string? Reason { get; set; }
Property Value
- string
The reason.
RunState
Gets or sets the RunState of this test fixture.
public RunState RunState { get; }
Property Value
TestName
Gets or sets the name of the test.
public string? TestName { get; set; }
Property Value
- string
The name of the test.
TestOf
The type that this fixture is testing
public Type? TestOf { get; set; }
Property Value
TypeArgs
Get or set the type arguments. If not set explicitly, any leading arguments that are Types are taken as type arguments.
public Type[] TypeArgs { get; set; }
Property Value
- Type[]
Methods
BuildFrom(ITypeInfo)
Builds a single test fixture from the specified type.
public IEnumerable<TestSuite> BuildFrom(ITypeInfo typeInfo)
Parameters
typeInfo
ITypeInfo
Returns
BuildFrom(ITypeInfo, IPreFilter)
Builds a single test fixture from the specified type.
public IEnumerable<TestSuite> BuildFrom(ITypeInfo typeInfo, IPreFilter filter)
Parameters
typeInfo
ITypeInfoThe type info of the fixture to be used.
filter
IPreFilterFilter used to select methods as tests.