Header menu logo FCQRS

TestEnvelope Type

C#-friendly builders for the Command/Event envelopes that the pure handleCommand/applyEvent functions expect. Intended for unit tests: the envelope's plumbing fields (a fresh MessageId/CID, a UTC timestamp, no sender, empty metadata) are filled in for you, so a test supplies only the payload — and, for events, the aggregate version. The framework builds these envelopes itself at runtime; tests are the one place you build them by hand.

Static members

Static member Description

TestEnvelope.Command(details)

Full Usage: TestEnvelope.Command(details)

Parameters:
    details : 'T

Returns: Command<'T>

Wrap a command payload in a Command envelope using the system clock.

details : 'T
Returns: Command<'T>

TestEnvelope.Command(details, timeProvider)

Full Usage: TestEnvelope.Command(details, timeProvider)

Parameters:
Returns: Command<'T>

Wrap a command payload in a Command envelope, stamping CreationDate from the given TimeProvider. Pass a FakeTimeProvider to test time-dependent decision logic (e.g. sliding-window quotas) deterministically.

details : 'T
timeProvider : TimeProvider
Returns: Command<'T>

TestEnvelope.Event(details, version)

Full Usage: TestEnvelope.Event(details, version)

Parameters:
    details : 'T
    version : int64

Returns: Event<'T>

Wrap an event payload in an Event envelope using the system clock.

details : 'T
version : int64
Returns: Event<'T>

TestEnvelope.Event(details, version, timeProvider)

Full Usage: TestEnvelope.Event(details, version, timeProvider)

Parameters:
Returns: Event<'T>

Wrap an event payload in an Event envelope carrying the given version, stamping CreationDate from the given TimeProvider.

details : 'T
version : int64
timeProvider : TimeProvider
Returns: Event<'T>

Type something to start searching.