Class TestSuite
TestSuite represents a composite test, which contains other tests.
public class TestSuite : Test, ITest, IXmlNodeBuilder, IComparable, IComparable<Test>
- Inheritance
-
TestSuite
- Implements
- Derived
- Inherited Members
Constructors
TestSuite(ITypeInfo, object?[]?)
Initializes a new instance of the TestSuite class.
public TestSuite(ITypeInfo fixtureType, object?[]? arguments = null)
Parameters
fixtureType
ITypeInfoType of the fixture.
arguments
object[]Arguments used to instantiate the test fixture, or null if none used.
TestSuite(TestSuite, ITestFilter)
Creates a copy of the given suite with only the descendants that pass the specified filter.
public TestSuite(TestSuite suite, ITestFilter filter)
Parameters
suite
TestSuiteThe TestSuite to copy.
filter
ITestFilterDetermines which descendants are copied.
TestSuite(string)
Initializes a new instance of the TestSuite class.
public TestSuite(string name)
Parameters
name
stringThe name of the suite.
TestSuite(string?, string)
Initializes a new instance of the TestSuite class.
public TestSuite(string? parentSuiteName, string name)
Parameters
TestSuite(Type)
Initializes a new instance of the TestSuite class.
public TestSuite(Type fixtureType)
Parameters
fixtureType
TypeType of the fixture.
Properties
Arguments
The arguments to use in creating the fixture, or empty array if none are provided.
public override object?[] Arguments { get; }
Property Value
- object[]
HasChildren
Gets a bool indicating whether the current test has any descendant tests.
public override bool HasChildren { get; }
Property Value
MaintainTestOrder
Set to true to suppress sorting this suite's contents
protected bool MaintainTestOrder { get; set; }
Property Value
OneTimeSetUpMethods
OneTimeSetUp methods for this suite
public IMethodInfo[] OneTimeSetUpMethods { get; protected set; }
Property Value
OneTimeTearDownMethods
OneTimeTearDown methods for this suite
public IMethodInfo[] OneTimeTearDownMethods { get; protected set; }
Property Value
TestCaseCount
Gets a count of test cases represented by or contained under this test.
public override int TestCaseCount { get; }
Property Value
Tests
Gets this test's child tests
public override IList<ITest> Tests { get; }
Property Value
XmlElementName
Gets the name used for the top-level element in the XML representation of this test
public override string XmlElementName { get; }
Property Value
Methods
Add(Test)
Adds a test to the suite.
public void Add(Test test)
Parameters
test
TestThe test.
AddToXml(TNode, bool)
Returns an XmlNode representing the current result after adding it as a child of the supplied parent node.
public override TNode AddToXml(TNode parentNode, bool recursive)
Parameters
Returns
ApplyAttributesToTestSuite(Type)
Recursively apply the attributes on type
to this test suite,
including attributes on nesting types.
public void ApplyAttributesToTestSuite(Type type)
Parameters
type
TypeThe
CheckSetUpTearDownMethods(IMethodInfo[])
Check that setup and teardown methods marked by certain attributes meet NUnit's requirements and mark the tests not runnable otherwise.
protected void CheckSetUpTearDownMethods(IMethodInfo[] methods)
Parameters
methods
IMethodInfo[]
Copy(ITestFilter)
Creates a filtered copy of the test suite.
public virtual TestSuite Copy(ITestFilter filter)
Parameters
filter
ITestFilterDetermines which descendants are copied.
Returns
MakeTestResult()
Overridden to return a TestSuiteResult.
public override TestResult MakeTestResult()
Returns
- TestResult
A TestResult for this test.
Sort()
Sorts tests under this suite.
public void Sort()