Table of Contents

Method ValidateObjectState

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

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.

public void ValidateObjectState()

Exceptions

Throw when one or more properties are missing 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.

protected abstract void ValidateObjectState(HashSet<string> invalidProperties)

Parameters

invalidProperties HashSet<string>

The hash set to record invalid properties into