Table of Contents

Class SerializationHelper

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

Serializes and de-serializes objects. It supports a limited set of built-in types, as well as anything which implements IXunitSerializable. Custom serializers can implement IXunitSerializer and register by decorating the test assembly with RegisterXunitSerializerAttribute.

public class SerializationHelper
Inheritance
SerializationHelper
Inherited Members

Constructors

SerializationHelper()

Initializes a new instance of the SerializationHelper class.

Properties

Instance

Gets the singleton instance of SerializationHelper.

Methods

AddRegisteredSerializers(Assembly, List<string>?)

Add serializers that have been registered in the given assembly.

AddSerializers(IRegisterXunitSerializerAttribute[], List<string>?)

Add serializers to the supported serializer list.

Deserialize(string)

De-serializes an object.

Deserialize<T>(string)

De-serializes an object.

IsSerializable(object?)

Determines if an object instance is serializable.

IsSerializable(object?, Type?)

Determines if a given type supports serialization.

Serialize(object?, Type?)

Serializes an object.

SerializedTypeNameToType(string)

Converts a type name (in "TypeName" format for mscorlib types, or "TypeName,AssemblyName" format for all others) into a Type object.

TypeToSerializedTypeName(Type)

Gets an assembly qualified type name for serialization.