OpinionatedEventing.Testing 0.9.0

dotnet add package OpinionatedEventing.Testing --version 0.9.0
                    
NuGet\Install-Package OpinionatedEventing.Testing -Version 0.9.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpinionatedEventing.Testing" Version="0.9.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpinionatedEventing.Testing" Version="0.9.0" />
                    
Directory.Packages.props
<PackageReference Include="OpinionatedEventing.Testing">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpinionatedEventing.Testing --version 0.9.0
                    
#r "nuget: OpinionatedEventing.Testing, 0.9.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpinionatedEventing.Testing@0.9.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpinionatedEventing.Testing&version=0.9.0
                    
Install as a Cake Addin
#tool nuget:?package=OpinionatedEventing.Testing&version=0.9.0
                    
Install as a Cake Tool

OpinionatedEventing.Testing

Test helpers for OpinionatedEventing. Provides in-memory fakes and a fluent builder for unit testing handlers, sagas, and aggregates without any infrastructure.

Not for production use.

Installation

dotnet add package OpinionatedEventing.Testing

What's included

Type Purpose
InMemoryOutboxStore IOutboxStore backed by a List<OutboxMessage>
FakePublisher IPublisher that captures sent commands and published events
TestMessagingBuilder Fluent builder that wires up a full in-memory DI container

Usage

FakePublisher

var publisher = new FakePublisher();
var handler = new PlaceOrderHandler(publisher);

await handler.HandleAsync(new PlaceOrder(orderId), CancellationToken.None);

Assert.Single(publisher.PublishedEvents.OfType<OrderPlaced>());

TestMessagingBuilder

var host = new TestMessagingBuilder()
    .WithHandler<OrderPlacedHandler>()
    .Build();

var publisher = host.Services.GetRequiredService<IPublisher>();
await publisher.PublishEventAsync(new OrderPlaced(Guid.NewGuid()));

// assert side effects via your fake dependencies

InMemoryOutboxStore

var store = new InMemoryOutboxStore();
// inject into the class under test
// inspect store.Messages after the act

Repository

github.com/SierraNL/OpinionatedEventing

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.0 86 5/8/2026