Class SheetModelAssertions

Namespace
ProtoTest.Sheets
Assembly
ProtoTest.Sheets.dll

Row-level shape assertions for record models and table rows. A row serializes with its property names (record models) or its leaf header names (table rows) and is matched by the same ProtoShapeAssertion the protocol integrations use. A model row traces on the ambient Context; a table row traces on the context its table carries, so a row asserted from a helper flow that does not see the ambient context still lands under the owning test.

public static class SheetModelAssertions
Inheritance
SheetModelAssertions
Inherited Members

Methods

ShouldMatchShape<TRow>(TRow, object, bool, JsonSerializerOptions?)

Matches one model row against an expected shape exactly, so a property the shape does not mention fails. Returns the row.

public static TRow ShouldMatchShape<TRow>(this TRow row, object expectedShape, bool exact, JsonSerializerOptions? options = null)

Parameters

row TRow
expectedShape object
exact bool
options JsonSerializerOptions

Returns

TRow

Type Parameters

TRow

ShouldMatchShape<TRow>(TRow, object, JsonSerializerOptions?)

Matches one model row against an expected shape and traces the assertion. Returns the row.

public static TRow ShouldMatchShape<TRow>(this TRow row, object expectedShape, JsonSerializerOptions? options = null)

Parameters

row TRow
expectedShape object
options JsonSerializerOptions

Returns

TRow

Type Parameters

TRow

Remarks

A model row is a user record, so C# cannot give it a Should extension property; this extension is the documented generic-subject exception. A failure names the record type.