Table of Contents

Interface IXunitSerializationInfo

Namespace
Xunit.Sdk

An interface that is implemented by the serialization infrastructure in xUnit.net. This is passed to objects which implement IXunitSerializable so they can serialize and deserialize themselves from the serialization store.

public interface IXunitSerializationInfo
Extension Methods

Methods

AddValue(string, object?, Type?)

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.

void AddValue(string key, object? value, Type? valueType)

Parameters

key string

The key to store the value with

value object

The value to be stored

valueType Type

The type of the value to be stored; optional, unless the value of value is null.

Exceptions

ArgumentException

Thrown if the value is not a supported type.

GetValue(string)

Gets a value from the serialization.

object? GetValue(string key)

Parameters

key string

The key of the value to retrieve

Returns

object

The value, if present; null, otherwise