Table of Contents

Namespace NUnit.Framework.Interfaces

Classes

AttributeDictionary

Class used to represent the attributes of a node

NodeList

Class used to represent a list of XmlResults

ResultState

The ResultState class represents the outcome of running a test. It contains two pieces of information. The Status of the test is an enum indicating whether the test passed, failed, was skipped or was inconclusive. The Label provides a more detailed breakdown for use by client runners.

TNode

TNode represents a single node in the XML representation of a Test or TestResult. It replaces System.Xml.XmlNode and System.Xml.Linq.XElement, providing a minimal set of methods for operating on the XML in a platform-independent manner.

Interfaces

IApplyToContext

The IApplyToContext interface is implemented by attributes that want to make changes to the execution context before a test is run.

IApplyToTest

The IApplyToTest interface is implemented by self-applying attributes that modify the state of a test in some way.

ICombiningStrategy

CombiningStrategy is the abstract base for classes that know how to combine values provided for individual test parameters to create a set of test cases.

ICommandWrapper

ICommandWrapper is implemented by attributes and other objects able to wrap a TestCommand with another command.

IFixtureBuilder

The IFixtureBuilder interface is exposed by a class that knows how to build a TestFixture from one or more Types. In general, it is exposed by an attribute, but may be implemented in a helper class used by the attribute in some cases.

IImplyFixture

IImplyFixture is an empty marker interface used by attributes like TestAttribute that cause the class where they are used to be treated as a TestFixture even without a TestFixtureAttribute.

Marker interfaces are not usually considered a good practice, but we use it here to avoid cluttering the attribute hierarchy with classes that don't contain any extra implementation.

IParameterDataProvider

The IDataPointProvider interface is used by extensions that provide data for a single test parameter.

IParameterDataSource

The IParameterDataSource interface is implemented by types that can provide data for a test method parameter.

IPropertyBag

A PropertyBag represents a collection of name/value pairs that allows duplicate entries with the same key. Methods are provided for adding a new pair as well as for setting a key to a single value. All keys are strings but _values may be of any type. Null _values are not permitted, since a null entry represents the absence of the key.

The entries in a PropertyBag are of two kinds: those that take a single value and those that take multiple _values. However, the PropertyBag has no knowledge of which entries fall into each category and the distinction is entirely up to the code using the PropertyBag.

When working with multi-valued properties, client code should use the Add method to add name/value pairs and indexing to retrieve a list of all _values for a given key. For example:

bag.Add("Tag", "one");
bag.Add("Tag", "two");
Assert.That(bag["Tag"],
  Is.EqualTo(new string[] { "one", "two" })); 

When working with single-valued propeties, client code should use the Set method to set the value and Get to retrieve the value. The GetSetting methods may also be used to retrieve the value in a type-safe manner while also providing default. For example:

bag.Set("Priority", "low");
bag.Set("Priority", "high"); // replaces value
Assert.That(bag.Get("Priority"),
  Is.EqualTo("high"));
Assert.That(bag.GetSetting("Priority", "low"),
  Is.EqualTo("high"));
ISimpleTestBuilder

The ISimpleTestBuilder interface is exposed by a class that knows how to build a single TestMethod from a suitable MethodInfo Types. In general, it is exposed by an attribute, but may be implemented in a helper class used by the attribute in some cases.

ISuiteBuilder

The ISuiteBuilder interface is exposed by a class that knows how to build a suite from one or more Types.

ITest

Common interface supported by all representations of a test. Only includes informational fields. The Run method is specifically excluded to allow for data-only representations of a test.

ITestBuilder

The ITestBuilder interface is exposed by a class that knows how to build one or more TestMethods from a MethodInfo. In general, it is exposed by an attribute, which has additional information available to provide the necessary test parameters to distinguish the test cases built.

ITestCaseBuilder

The ITestCaseBuilder interface is exposed by a class that knows how to build a test case from certain methods.

ITestCaseData

The ITestCaseData interface is implemented by a class that is able to return complete testcases for use by a parameterized test method.

ITestData

The ITestData interface is implemented by a class that represents a single instance of a parameterized test.

ITestFilter

Interface to be implemented by filters applied to tests. The filter applies when running the test, after it has been loaded, since this is the only time an ITest exists.

ITestFixtureData

The ITestCaseData interface is implemented by a class that is able to return the data required to create an instance of a parameterized test fixture.

ITestListener

The ITestListener interface is used internally to receive notifications of significant events while a test is being run. The events are propagated to clients by means of an AsyncCallback. NUnit extensions may also monitor these events.

ITestResult

The ITestResult interface represents the result of a test.

IWrapSetUpTearDown

Objects implementing this interface are used to wrap the entire test, including SetUp and TearDown.

IWrapTestMethod

Objects implementing this interface are used to wrap the TestMethodCommand itself. They apply after SetUp has been run and before TearDown.

IXmlNodeBuilder

An object implementing IXmlNodeBuilder is able to build an XML representation of itself and any children.

Enums

FailureSite

The FailureSite enum indicates the stage of a test in which an error or failure occurred.

RunState

The RunState enum indicates whether a test can be executed.

TestStatus

The TestStatus enum indicates the result of running a test