Table of Contents

Class MessageSinkMessage

Namespace
Xunit.v3
Assembly
xunit.v3.core.dll

Default implementation of IMessageSinkMessage, with serialization support.

public abstract class MessageSinkMessage : IMessageSinkMessage, IJsonSerializable
Inheritance
MessageSinkMessage
Implements
Derived
Inherited Members

Remarks

Because of serialization, all concrete message sink message types must be decorated with JsonTypeIDAttribute to set a unique type ID for serialization purposes.

Constructors

MessageSinkMessage()

Initializes a new instance of the see MessageSinkMessage class.

Methods

Serialize(JsonObjectSerializer)

Override to serialize the values in the message into JSON.

ToDisplayString(string?[]?)

Converts a string array into a display value, for use in an ToString() overload.

ToDisplayString<T>(T[]?)

Converts am array into a display value, for use in an ToString() overload.

ToJson()

Creates a JSON serialized version of this message.

ValidateObjectState()

Validates the state of the message object. This should be called just before serializing the message or just after deserializing the message to ensure that the message is not missing any required property values.

ValidateObjectState(HashSet<string>)

Called before serializing the message. Implementers are expected to call ValidatePropertyIsNotNull(object?, string, HashSet<string>) for each property that must have a value, to record invalid property values into the provided hash set.

ValidatePropertyIsNotNull(object?, string, HashSet<string>)

Validates that the property value is not null, and if it is, adds the given property name to the invalid property hash set.