Table of Contents

Class JsonSerializerBase

Namespace
Xunit.Sdk

Base class used for streaming JSON serialization.

public abstract class JsonSerializerBase : IDisposable
Inheritance
JsonSerializerBase
Implements
Derived
Inherited Members
Extension Methods

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

JsonSerializerBase(StringBuilder, Action?, char?, char?)

Initializes a new instance of the JsonSerializerBase class.

protected JsonSerializerBase(StringBuilder buffer, Action? disposeNotifier = null, char? open = null, char? close = null)

Parameters

buffer StringBuilder

The buffer to write JSON to

disposeNotifier Action

A callback to be notified when disposed

open char?

The character to write when starting (i.e., '[' for arrays)

close char?

The character to write when finishing (i.e., ']' for arrays)

Properties

Buffer

protected StringBuilder Buffer { get; }

Property Value

StringBuilder

Methods

Dispose()

public void Dispose()

WriteSeparator()

protected void WriteSeparator()

WriteValue(Enum?)

protected void WriteValue(Enum? value)

Parameters

value Enum

WriteValue(bool?)

protected void WriteValue(bool? value)

Parameters

value bool?

WriteValue(DateTimeOffset?)

protected void WriteValue(DateTimeOffset? value)

Parameters

value DateTimeOffset?

WriteValue(decimal?)

protected void WriteValue(decimal? value)

Parameters

value decimal?

WriteValue(int?)

protected void WriteValue(int? value)

Parameters

value int?

WriteValue(long?)

protected void WriteValue(long? value)

Parameters

value long?

WriteValue(string?)

protected void WriteValue(string? value)

Parameters

value string