Class StubHttpExchangeSnapshot

Namespace
XBullet.EasyTesting.Snapshots
Assembly
XBullet.EasyTesting.Snapshots.Http.dll

A stable representation of one captured outbound HTTP exchange.

public sealed class StubHttpExchangeSnapshot
Inheritance
StubHttpExchangeSnapshot
Inherited Members

Properties

Failure

Gets the send failure, when no response was produced.

public StubHttpFailureSnapshot? Failure { get; }

Property Value

StubHttpFailureSnapshot

The stable send-failure snapshot, or null when no failure existed at snapshot creation time. Failure messages are copied without automatic redaction.

Request

Gets the captured request.

public StubHttpRequestSnapshot Request { get; }

Property Value

StubHttpRequestSnapshot

The non-null, stable request snapshot owned by this exchange snapshot.

Response

Gets the captured response, when one was produced.

public StubHttpResponseSnapshot? Response { get; }

Property Value

StubHttpResponseSnapshot

The stable response snapshot, or null when no response existed at snapshot creation time.

Methods

FromExchange(StubHttpExchange, StubHttpExchangeSnapshotOptions?)

Creates a deterministic snapshot model from a captured exchange.

public static StubHttpExchangeSnapshot FromExchange(StubHttpExchange exchange, StubHttpExchangeSnapshotOptions? options = null)

Parameters

exchange StubHttpExchange

The non-null exchange whose current request, response, and failure state is copied. The method does not own, retain, or mutate it; later response-body capture does not change the returned snapshot.

options StubHttpExchangeSnapshotOptions

Request, response, and output-format settings to read, or null to use a new default options instance. The format is retained in the options for assertion extensions but does not alter this in-memory model.

Returns

StubHttpExchangeSnapshot

A new stable exchange snapshot containing copied and normalized values.