Table of Contents

Class ExecutionErrorTestCase

Namespace
Xunit.v3
Assembly
xunit.v3.core.dll

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

testMethod IXunitTestMethod

The test method.

testCaseDisplayName string

The display name for the test case.

uniqueID string

The unique ID for the test case.

errorMessage string

The 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

string

Methods

CreateTests()

Throws the expected error mesage rather than creating tests.

public override ValueTask<IReadOnlyCollection<IXunitTest>> CreateTests()

Returns

ValueTask<IReadOnlyCollection<IXunitTest>>

Deserialize(IXunitSerializationInfo)

Called when the test case should populate itself with data from the serialization info.

protected override void Deserialize(IXunitSerializationInfo info)

Parameters

info IXunitSerializationInfo

The 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

info IXunitSerializationInfo

The info to store the object data into