Class ExecutionErrorTestCase
A simple implementation of IXunitTestCase that can be used to report an error rather than running a test.
public class ExecutionErrorTestCase : XunitTestCase, IXunitTestCase, ITestCase, ITestCaseMetadata, IXunitSerializable, IAsyncDisposable
- Inheritance
-
ExecutionErrorTestCase
- Implements
- Inherited Members
Constructors
ExecutionErrorTestCase()
Called by the de-serializer; should only be called by deriving classes for de-serialization purposes
[Obsolete("Called by the de-serializer; should only be called by deriving classes for de-serialization purposes")]
public ExecutionErrorTestCase()
ExecutionErrorTestCase(IXunitTestMethod, string, string, string)
Initializes a new instance of the ExecutionErrorTestCase class.
public ExecutionErrorTestCase(IXunitTestMethod testMethod, string testCaseDisplayName, string uniqueID, string errorMessage)
Parameters
testMethodIXunitTestMethodThe test method.
testCaseDisplayNamestringThe display name for the test case.
uniqueIDstringThe unique ID for the test case.
errorMessagestringThe error message to report for the test.
Properties
ErrorMessage
Gets the error message that will be displayed when the test is run.
public string ErrorMessage { get; }
Property Value
Methods
CreateTests()
Throws the expected error mesage rather than creating tests.
public override ValueTask<IReadOnlyCollection<IXunitTest>> CreateTests()
Returns
Deserialize(IXunitSerializationInfo)
Called when the test case should populate itself with data from the serialization info.
protected override void Deserialize(IXunitSerializationInfo info)
Parameters
infoIXunitSerializationInfoThe info to get the object data from
Serialize(IXunitSerializationInfo)
Called when the test case should store its serialized values into the serialization info.
protected override void Serialize(IXunitSerializationInfo info)
Parameters
infoIXunitSerializationInfoThe info to store the object data into