Class TestCaseAttribute
TestCaseAttribute is used to mark parameterized test cases and provide them with their arguments.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public class TestCaseAttribute : TestCaseBuilderAttribute, ITestBuilder, ITestCaseData, IImplyFixture
- Inheritance
-
TestCaseAttribute
- Implements
- Inherited Members
Constructors
TestCaseAttribute(object)
Construct a TestCaseAttribute with a single argument
public TestCaseAttribute(object arg)
Parameters
arg
object
TestCaseAttribute(object, object)
Construct a TestCaseAttribute with a two arguments
public TestCaseAttribute(object arg1, object arg2)
Parameters
TestCaseAttribute(object, object, object)
Construct a TestCaseAttribute with a three arguments
public TestCaseAttribute(object arg1, object arg2, object arg3)
Parameters
TestCaseAttribute(params object[])
Construct a TestCaseAttribute with a list of arguments. This constructor is not CLS-Compliant
public TestCaseAttribute(params object[] arguments)
Parameters
arguments
object[]
Properties
Arguments
Gets the list of arguments to a test case
public object[] Arguments { get; }
Property Value
- object[]
Author
The author of this test
public string Author { get; set; }
Property Value
Category
Gets and sets the category for this fixture. May be a comma-separated list of categories.
public string Category { get; set; }
Property Value
Description
Gets or sets the description.
public string Description { get; set; }
Property Value
- string
The description.
ExpectedResult
Gets or sets the expected result.
public object ExpectedResult { get; set; }
Property Value
- object
The result.
Explicit
Gets or sets a value indicating whether this TestCaseAttribute is explicit.
public bool Explicit { get; set; }
Property Value
- bool
true
if explicit; otherwise,false
.
HasExpectedResult
Returns true if the expected result has been set
public bool HasExpectedResult { get; }
Property Value
Ignore
Gets or sets the ignored status of the test
public bool Ignore { get; set; }
Property Value
IgnoreReason
Gets or sets the ignore reason. When set to a non-null non-empty value, the test is marked as ignored.
public string IgnoreReason { get; set; }
Property Value
- string
The ignore reason.
Properties
NYI
public IPropertyBag Properties { get; }
Property Value
Reason
Gets or sets the reason for not running the test.
public string Reason { get; set; }
Property Value
- string
The reason.
RunState
Gets or sets the RunState of this test case.
public RunState RunState { get; }
Property Value
TestName
Gets or sets the name of the test.
public string TestName { get; set; }
Property Value
- string
The name of the test.
TestOf
The type that this test is testing
public Type TestOf { get; set; }
Property Value
Methods
BuildFrom(MethodInfo, Test)
Construct one or more TestMethods from a given MethodInfo, using available parameter data.
public IEnumerable<TestMethod> BuildFrom(MethodInfo method, Test suite)
Parameters
method
MethodInfoThe MethodInfo for which tests are to be constructed.
suite
TestThe suite to which the tests will be added.
Returns
- IEnumerable<TestMethod>
One or more TestMethods