Class TestCaseData
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
argobjectThe argument.
TestCaseData(object, object)
Initializes a new instance of the TestCaseData class.
public TestCaseData(object arg1, object arg2)
Parameters
TestCaseData(object, object, object)
Initializes a new instance of the TestCaseData class.
public TestCaseData(object arg1, object arg2, object arg3)
Parameters
TestCaseData(params object[])
Initializes a new instance of the TestCaseData class.
public TestCaseData(params object[] args)
Parameters
argsobject[]The arguments.
Methods
Explicit()
Marks the test case as explicit.
public TestCaseData Explicit()
Returns
Explicit(string)
Marks the test case as explicit, specifying the reason.
public TestCaseData Explicit(string reason)
Parameters
reasonstring
Returns
Ignore()
Ignores this TestCase.
public TestCaseData Ignore()
Returns
Ignore(string)
Ignores this TestCase, specifying the reason.
public TestCaseData Ignore(string reason)
Parameters
reasonstringThe reason.
Returns
Returns(object)
Sets the expected result for the test
public TestCaseData Returns(object result)
Parameters
resultobjectThe expected result
Returns
- TestCaseData
A modified TestCaseData
SetCategory(string)
Applies a category to the test
public TestCaseData SetCategory(string category)
Parameters
categorystring
Returns
SetDescription(string)
Sets the description for the test case being constructed.
public TestCaseData SetDescription(string description)
Parameters
descriptionstringThe description.
Returns
- TestCaseData
The modified TestCaseData instance.
SetName(string)
Sets the name of the test case
public TestCaseData SetName(string name)
Parameters
namestring
Returns
- TestCaseData
The modified TestCaseData instance
SetProperty(string, double)
Applies a named property to the test
public TestCaseData SetProperty(string propName, double propValue)
Parameters
Returns
SetProperty(string, int)
Applies a named property to the test
public TestCaseData SetProperty(string propName, int propValue)
Parameters
Returns
SetProperty(string, string)
Applies a named property to the test
public TestCaseData SetProperty(string propName, string propValue)