Skip to main content
Table of Contents

Class RecordingEventBundleOutboxDispatcher

Namespace
Stratara.Testing.EntityFrameworkCore
Assembly
Stratara.Testing.EntityFrameworkCore.dll

An IEventBundleOutboxDispatcher test double that records every dispatched bundle instead of publishing to a broker. Lets tests assert which events the write side emitted on SaveChangesAsync without standing up RabbitMQ or Azure Service Bus.

public sealed class RecordingEventBundleOutboxDispatcher : IEventBundleOutboxDispatcher
Inheritance
RecordingEventBundleOutboxDispatcher
Implements
Inherited Members
Extension Methods

Properties

Bundles

Every bundle handed to EnqueueEventBundleAsync(EventBundle, CancellationToken), in dispatch order.

public IReadOnlyList<EventBundle> Bundles { get; }

Property Value

IReadOnlyList<EventBundle>

Methods

EnqueueEventBundleAsync(EventBundle, CancellationToken)

Enqueue eventBundle for asynchronous dispatch.

public Task EnqueueEventBundleAsync(EventBundle eventBundle, CancellationToken cancellationToken = default)

Parameters

eventBundle EventBundle
cancellationToken CancellationToken

Returns

Task

EnqueueOutboxEntriesAsync(IEnumerable<OutboxEntry>, CancellationToken)

Drain previously-persisted outboxEntries by attempting to publish each one and deleting on success. Used by the outbox worker.

public Task EnqueueOutboxEntriesAsync(IEnumerable<OutboxEntry> outboxEntries, CancellationToken cancellationToken = default)

Parameters

outboxEntries IEnumerable<OutboxEntry>
cancellationToken CancellationToken

Returns

Task