Class ProtoMessageAssertions

Namespace
ProtoTest.Messaging
Assembly
ProtoTest.Messaging.dll

The shape assertions of one consumed message, reached through Should. Shape has no negated form, so the facade is positive-only. MatchShape(object, JsonSerializerOptions?) returns the message, so assertions chain.

public sealed class ProtoMessageAssertions
Inheritance
ProtoMessageAssertions
Inherited Members
Extension Methods

Methods

MatchShape(object, bool, JsonSerializerOptions?)

Matches the payload against the expected shape exactly through the shared matcher, so a field the shape does not mention is a mismatch naming the field; a value constraint mentions its whole subtree. Returns the message.

public ProtoMessage MatchShape(object expectedShape, bool exact, JsonSerializerOptions? options = null)

Parameters

expectedShape object
exact bool
options JsonSerializerOptions

Returns

ProtoMessage

MatchShape(object, JsonSerializerOptions?)

Matches the payload against the expected shape through the shared matcher and records the assertion on the ambient Context. A mismatch - or an empty or non-Json payload - is rethrown as a MessagingAssertionException whose message starts with the destination, with the matcher exception as the inner exception. Returns the message.

public ProtoMessage MatchShape(object expectedShape, JsonSerializerOptions? options = null)

Parameters

expectedShape object
options JsonSerializerOptions

Returns

ProtoMessage