Show / Hide Table of Contents

Interface IXunitTestCase

Represents a single test case from xUnit.net v2.

Namespace: Xunit.Sdk
Assembly: xunit.core.dll
Syntax
public interface IXunitTestCase : ITestCase

Properties

| Improve this Doc View Source

InitializationException

Gets the exception that happened during initialization. When this is set, then the test execution should fail with this exception.

Declaration
Exception InitializationException { get; }
Property Value
Type Description
Exception
| Improve this Doc View Source

Method

Gets the method to be run. Differs from . in that any generic argument types will have been closed based on the arguments.

Declaration
IMethodInfo Method { get; }
Property Value
Type Description
IMethodInfo
| Improve this Doc View Source

Timeout

Gets the timeout of the test, in milliseconds; if zero or negative, means the test case has no timeout.

Declaration
int Timeout { get; }
Property Value
Type Description
Int32

Methods

| Improve this Doc View Source

RunAsync(IMessageSink, IMessageBus, Object[], ExceptionAggregator, CancellationTokenSource)

Executes the test case, returning 0 or more result messages through the message sink.

Declaration
Task<RunSummary> RunAsync(IMessageSink diagnosticMessageSink, IMessageBus messageBus, object[] constructorArguments, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)
Parameters
Type Name Description
IMessageSink diagnosticMessageSink

The message sink used to send diagnostic messages to.

IMessageBus messageBus

The message bus to report results to.

Object[] constructorArguments

The arguments to pass to the constructor.

ExceptionAggregator aggregator

The error aggregator to use for catching exception.

CancellationTokenSource cancellationTokenSource

The cancellation token source that indicates whether cancellation has been requested.

Returns
Type Description
Task<RunSummary>

Returns the summary of the test case run.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX