Table of Contents

Class TestCaseData

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

The TestCaseData class represents a set of arguments and other parameter info to be used for a parameterized test case. It is derived from ParameterSet and adds a fluent syntax for use in initializing the test case.

public class TestCaseData : ParameterSet, ITestCaseData, IApplyToTest
Inheritance
TestCaseData
Implements
Inherited Members

Constructors

TestCaseData(object)

Initializes a new instance of the TestCaseData class.

public TestCaseData(object arg)

Parameters

arg object

The argument.

TestCaseData(object, object)

Initializes a new instance of the TestCaseData class.

public TestCaseData(object arg1, object arg2)

Parameters

arg1 object

The first argument.

arg2 object

The second argument.

TestCaseData(object, object, object)

Initializes a new instance of the TestCaseData class.

public TestCaseData(object arg1, object arg2, object arg3)

Parameters

arg1 object

The first argument.

arg2 object

The second argument.

arg3 object

The third argument.

TestCaseData(params object[])

Initializes a new instance of the TestCaseData class.

public TestCaseData(params object[] args)

Parameters

args object[]

The arguments.

Methods

Explicit()

Marks the test case as explicit.

public TestCaseData Explicit()

Returns

TestCaseData

Explicit(string)

Marks the test case as explicit, specifying the reason.

public TestCaseData Explicit(string reason)

Parameters

reason string

Returns

TestCaseData

Ignore()

Ignores this TestCase.

public TestCaseData Ignore()

Returns

TestCaseData

Ignore(string)

Ignores this TestCase, specifying the reason.

public TestCaseData Ignore(string reason)

Parameters

reason string

The reason.

Returns

TestCaseData

Returns(object)

Sets the expected result for the test

public TestCaseData Returns(object result)

Parameters

result object

The expected result

Returns

TestCaseData

A modified TestCaseData

SetCategory(string)

Applies a category to the test

public TestCaseData SetCategory(string category)

Parameters

category string

Returns

TestCaseData

SetDescription(string)

Sets the description for the test case being constructed.

public TestCaseData SetDescription(string description)

Parameters

description string

The description.

Returns

TestCaseData

The modified TestCaseData instance.

SetName(string)

Sets the name of the test case

public TestCaseData SetName(string name)

Parameters

name string

Returns

TestCaseData

The modified TestCaseData instance

SetProperty(string, double)

Applies a named property to the test

public TestCaseData SetProperty(string propName, double propValue)

Parameters

propName string
propValue double

Returns

TestCaseData

SetProperty(string, int)

Applies a named property to the test

public TestCaseData SetProperty(string propName, int propValue)

Parameters

propName string
propValue int

Returns

TestCaseData

SetProperty(string, string)

Applies a named property to the test

public TestCaseData SetProperty(string propName, string propValue)

Parameters

propName string
propValue string

Returns

TestCaseData