Vulthil.Messaging.TestHarness
1.2.0
dotnet add package Vulthil.Messaging.TestHarness --version 1.2.0
NuGet\Install-Package Vulthil.Messaging.TestHarness -Version 1.2.0
<PackageReference Include="Vulthil.Messaging.TestHarness" Version="1.2.0" />
<PackageVersion Include="Vulthil.Messaging.TestHarness" Version="1.2.0" />
<PackageReference Include="Vulthil.Messaging.TestHarness" />
paket add Vulthil.Messaging.TestHarness --version 1.2.0
#r "nuget: Vulthil.Messaging.TestHarness, 1.2.0"
#:package Vulthil.Messaging.TestHarness@1.2.0
#addin nuget:?package=Vulthil.Messaging.TestHarness&version=1.2.0
#tool nuget:?package=Vulthil.Messaging.TestHarness&version=1.2.0
Vulthil.Messaging.TestHarness
An in-memory messaging transport for tests: runs your consumers with no broker and captures produced and consumed messages for assertion.
Install
dotnet add package Vulthil.Messaging.TestHarness
Quick start
builder.AddMessaging(messaging =>
{
messaging.ConfigureQueue("orders", q => q.AddConsumer<OrderCreatedConsumer>());
messaging.UseTestHarness(); // in place of a broker transport
});
var harness = host.Services.GetRequiredService<ITestHarness>();
harness.Published<OrderCreatedEvent>().ShouldHaveSingleItem();
harness.Consumed<OrderCreatedEvent>().ShouldHaveSingleItem();
For an integration test that keeps the production composition, swap the transport instead:
services.ReplaceTransportWithTestHarness().
ITestHarness is a singleton, so a test class that reuses one host across tests should call Clear() from its
per-test setup hook — see the "Resetting between tests" section of the testing article linked below.
Docs
Usage patterns and articles: https://vulthil.github.io/Vulthil.SharedKernel/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Vulthil.Messaging (>= 1.2.0)
-
net9.0
- Vulthil.Messaging (>= 1.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.