Table of Contents

Class TestFrameworkOptions

Namespace
Xunit.Runner.Common
Assembly
xunit.v3.runner.common.dll

Represents options passed to a test framework for discovery or execution.

public class TestFrameworkOptions : ITestFrameworkDiscoveryOptions, ITestFrameworkExecutionOptions, ITestFrameworkOptions
Inheritance
TestFrameworkOptions
Implements
Inherited Members
Extension Methods

Methods

Empty()

INTERNAL METHOD, FOR TESTING PURPOSES ONLY. DO NOT CALL.

public static TestFrameworkOptions Empty()

Returns

TestFrameworkOptions

ForDiscovery(TestAssemblyConfiguration)

Creates an instance of TestFrameworkOptions for discovery purposes.

public static ITestFrameworkDiscoveryOptions ForDiscovery(TestAssemblyConfiguration configuration)

Parameters

configuration TestAssemblyConfiguration

The configuration to copy values from.

Returns

ITestFrameworkDiscoveryOptions

ForDiscoveryFromSerialization(string)

Creates an instance of TestFrameworkOptions for discovery purposes.

public static ITestFrameworkDiscoveryOptions ForDiscoveryFromSerialization(string optionsJson)

Parameters

optionsJson string

The serialized discovery options.

Returns

ITestFrameworkDiscoveryOptions

ForExecution(TestAssemblyConfiguration)

Creates an instance of TestFrameworkOptions for execution purposes.

public static ITestFrameworkExecutionOptions ForExecution(TestAssemblyConfiguration configuration)

Parameters

configuration TestAssemblyConfiguration

The configuration to copy values from.

Returns

ITestFrameworkExecutionOptions

ForExecutionFromSerialization(string)

Creates an instance of TestFrameworkOptions for execution purposes.

public static ITestFrameworkExecutionOptions ForExecutionFromSerialization(string optionsJson)

Parameters

optionsJson string

The serialized execution options.

Returns

ITestFrameworkExecutionOptions

GetValue<TValue>(string)

Gets a value from the options collection.

public TValue? GetValue<TValue>(string name)

Parameters

name string

The name of the value.

Returns

TValue

Returns the value.

Type Parameters

TValue

The type of the value.

SetValue<TValue>(string, TValue)

Sets a value into the options collection.

public void SetValue<TValue>(string name, TValue value)

Parameters

name string

The name of the value.

value TValue

The value.

Type Parameters

TValue

The type of the value.

ToJson()

Converts the test framework options into JSON. Used for serializing the options for sending across a process boundary.

public string ToJson()

Returns

string

The serialized framework options.