Table of Contents

Method AddValue

Namespace
Xunit.Sdk
Assembly
xunit.v3.common.dll

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.

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

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.