Table of Contents

Class TestSuite

Namespace
NUnit.Framework.Internal
Assembly
nunit.framework.dll

TestSuite represents a composite test, which contains other tests.

public class TestSuite : Test, ITest, IXmlNodeBuilder, IComparable
Inheritance
TestSuite
Implements
Derived
Inherited Members

Constructors

TestSuite(string)

Initializes a new instance of the TestSuite class.

public TestSuite(string name)

Parameters

name string

The name of the suite.

TestSuite(string, string)

Initializes a new instance of the TestSuite class.

public TestSuite(string parentSuiteName, string name)

Parameters

parentSuiteName string

Name of the parent suite.

name string

The name of the suite.

TestSuite(Type)

Initializes a new instance of the TestSuite class.

public TestSuite(Type fixtureType)

Parameters

fixtureType Type

Type of the fixture.

Properties

Arguments

The arguments to use in creating the fixture

public 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

bool

MaintainTestOrder

Set to true to suppress sorting this suite's contents

protected bool MaintainTestOrder { get; set; }

Property Value

bool

TestCaseCount

Gets a count of test cases represented by or contained under this test.

public override int TestCaseCount { get; }

Property Value

int

Tests

Gets this test's child tests

public override IList<ITest> Tests { get; }

Property Value

IList<ITest>

The list of child tests

XmlElementName

Gets the name used for the top-level element in the XML representation of this test

public override string XmlElementName { get; }

Property Value

string

Methods

Add(Test)

Adds a test to the suite.

public void Add(Test test)

Parameters

test Test

The test.

Add(object)

Adds a pre-constructed test fixture to the suite.

public void Add(object fixture)

Parameters

fixture object

The fixture.

AddToXml(XmlNode, bool)

Returns an XmlNode representing the current result after adding it as a child of the supplied parent node.

public override XmlNode AddToXml(XmlNode parentNode, bool recursive)

Parameters

parentNode XmlNode

The parent node.

recursive bool

If true, descendant results are included

Returns

XmlNode

CheckSetUpTearDownMethods(Type)

Check that setup and teardown methods marked by certain attributes meet NUnit's requirements and mark the tests not runnable otherwise.

protected void CheckSetUpTearDownMethods(Type attrType)

Parameters

attrType Type

The attribute type to check for

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()