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 TestCaseParameters and adds a fluent syntax for use in initializing the test case.
public class TestCaseData : TestCaseParameters, ITestCaseData, ITestData, IApplyToTest
- Inheritance
-
TestCaseData
- Implements
- Inherited Members
Constructors
TestCaseData(object?)
Initializes a new instance of the TestCaseData class.
public TestCaseData(object? arg)
Parameters
arg
objectThe 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
args
object[]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
reason
string
Returns
Ignore(string)
Ignores this TestCase, specifying the reason.
public IgnoredTestCaseData Ignore(string reason)
Parameters
reason
stringThe reason.
Returns
Returns(object?)
Sets the expected result for the test
public TestCaseData Returns(object? result)
Parameters
result
objectThe expected result
Returns
- TestCaseData
A modified TestCaseData
SetArgDisplayNames(params string[]?)
Sets the list of display names to use as the parameters in the test name.
public TestCaseData SetArgDisplayNames(params string[]? displayNames)
Parameters
displayNames
string[]
Returns
SetCategory(string)
Applies a category to the test
public TestCaseData SetCategory(string category)
Parameters
category
string
Returns
SetDescription(string)
Sets the description for the test case being constructed.
public TestCaseData SetDescription(string description)
Parameters
description
stringThe 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
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)