Table of Contents

Class XunitSerializationInfoExtensions

Namespace
Xunit.Sdk

Extension methods for IXunitSerializationInfo.

public static class XunitSerializationInfoExtensions
Inheritance
XunitSerializationInfoExtensions
Inherited Members

Methods

AddValue<T>(IXunitSerializationInfo, string, T)

Adds a value to the serialization. Supported value types include the built-in intrinsics (string, int, long, float, double, and decimal, including nullable versions of those), any class which implements IXunitSerializable), or arrays of any supported types.

public static void AddValue<T>(this IXunitSerializationInfo info, string key, T value)

Parameters

info IXunitSerializationInfo
key string

The key to store the value with

value T

The value to be stored

Type Parameters

T

GetValue<T>(IXunitSerializationInfo, string)

Gets a strongly-typed value from the serialization.

public static T? GetValue<T>(this IXunitSerializationInfo info, string key)

Parameters

info IXunitSerializationInfo
key string

The key of the value to retrieve

Returns

T

The value, if present; default(T), otherwise

Type Parameters

T

The type of the value