Table of Contents

Class TestMethod

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

The TestMethod class represents a Test implemented as a method.

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

Constructors

TestMethod(MethodInfo)

Initializes a new instance of the TestMethod class.

public TestMethod(MethodInfo method)

Parameters

method MethodInfo

The method to be used as a test.

TestMethod(MethodInfo, Test)

Initializes a new instance of the TestMethod class.

public TestMethod(MethodInfo method, Test parentSuite)

Parameters

method MethodInfo

The method to be used as a test.

parentSuite Test

The suite or fixture to which the new test will be added

Properties

HasChildren

Gets a bool indicating whether the current test has any descendant tests.

public override bool HasChildren { get; }

Property Value

bool

Tests

Gets this test's child tests

public override IList<ITest> Tests { get; }

Property Value

IList<ITest>

A 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

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

MakeTestResult()

Overridden to return a TestCaseResult.

public override TestResult MakeTestResult()

Returns

TestResult

A TestResult for this test.