Table of Contents

Class JsonObjectSerializer

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

A special-purpose streaming serializer for objects to JSON. Only supports a limited number of type (boolean, DateTimeOffset, decimal, Enum, int, long, string, and trait dictionaries).

public sealed class JsonObjectSerializer : JsonSerializerBase, IDisposable
Inheritance
JsonObjectSerializer
Implements
Inherited Members
Extension Methods
Xunit.Sdk.JsonSerializerExtensions.SerializeIntArray(Xunit.Sdk.JsonObjectSerializer,System.String,System.Collections.Generic.IEnumerable{System.Int32},System.Boolean)
Xunit.Sdk.JsonSerializerExtensions.SerializeStringArray(Xunit.Sdk.JsonObjectSerializer,System.String,System.Collections.Generic.IEnumerable{System.String},System.Boolean)
Xunit.Sdk.JsonSerializerExtensions.SerializeTraits(Xunit.Sdk.JsonObjectSerializer,System.String,System.Collections.Generic.IReadOnlyDictionary{System.String,System.Collections.Generic.IReadOnlyCollection{System.String}},System.Boolean)

Remarks

These types are made public for third parties only for the purpose of serializing and deserializing messages that are sent across the process boundary (that is, types which implement IMessageSinkMessage). Any other usage is not supported.

Constructors

JsonObjectSerializer(StringBuilder, Action?)

A special-purpose streaming serializer for objects to JSON. Only supports a limited number of type (boolean, DateTimeOffset, decimal, Enum, int, long, string, and trait dictionaries).

Methods

Serialize(string, Enum?, bool)

Serialize an Enum value into the object.

Serialize(string, bool?, bool)

Serialize a bool value into the object.

Serialize(string, DateTimeOffset?, bool)

Serialize a DateTimeOffset value into the object.

Serialize(string, decimal?, bool)

Serialize a decimal value into the object.

Serialize(string, int?, bool)

Serialize an int value into the object.

Serialize(string, long?, bool)

Serialize a long value into the object.

Serialize(string, string?, bool, bool)

Serialize a string value into the object.

SerializeArray(string)

Start serializing an array into the object.

SerializeNull(string)

Serialize a null value into the object.

SerializeObject(string)

Start serializing an object into the object.