Table of Contents

Class RegisterXunitSerializerAttribute

Namespace
Xunit.Sdk

Used to decorate xUnit.net test assemblies to register an external serializer for one or more supports types to serialize.

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)]
public sealed class RegisterXunitSerializerAttribute : Attribute, IRegisterXunitSerializerAttribute
Inheritance
RegisterXunitSerializerAttribute
Implements
Inherited Members
Extension Methods

Constructors

RegisterXunitSerializerAttribute(Type, params Type[])

Used to decorate xUnit.net test assemblies to register an external serializer for one or more supports types to serialize.

public RegisterXunitSerializerAttribute(Type serializerType, params Type[] supportedTypesForSerialization)

Parameters

serializerType Type

The type of the serializer. Must implement IXunitSerializer.

supportedTypesForSerialization Type[]

The types that are supported by the serializer.

Properties

SerializerType

Gets the type of the serializer.

public Type SerializerType { get; }

Property Value

Type

Remarks

The serializer type must implement IXunitSerializer.

SupportedTypesForSerialization

Gets the types that are supported by the serializer.

public Type[] SupportedTypesForSerialization { get; }

Property Value

Type[]

Remarks

When searching for a serializer to deserialize a value, exact type matches are given higher priority than compatible type matches, and if more than one serializer can support a given type based on compatible type match, then one will be chosen arbitrarily to support the deserialization.