Class GraphQLShouldAssertions

Namespace
ProtoTest.GraphQL
Assembly
ProtoTest.GraphQL.dll

The positive assertions of a GraphQL response, reached through Should. Shape is positive-only - a negated shape match has no meaning - so it lives here and not on the shared facade ShouldNot returns. MatchShape(object, JsonSerializerOptions?) returns the response, so assertions chain.

public sealed class GraphQLShouldAssertions : GraphQLAssertions
Inheritance
GraphQLShouldAssertions
Inherited Members
Extension Methods

Methods

MatchShape(object, bool, JsonSerializerOptions?)

Matches the selected data against the expected shape exactly: a field present in the data that the shape does not mention is a mismatch naming the field. A value constraint mentions its whole subtree. Returns the response.

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

Parameters

expectedShape object
exact bool
options JsonSerializerOptions

Returns

GraphQLResponse

MatchShape(object, JsonSerializerOptions?)

Matches the selected data against the expected shape and records the assertion on the test context. Every mismatch is reported at once, and the failure message starts with the operation identifier. Returns the response.

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

Parameters

expectedShape object
options JsonSerializerOptions

Returns

GraphQLResponse