ProtoTest.Messaging
1.1.5
See the version list below for details.
dotnet add package ProtoTest.Messaging --version 1.1.5
NuGet\Install-Package ProtoTest.Messaging -Version 1.1.5
<PackageReference Include="ProtoTest.Messaging" Version="1.1.5" />
<PackageVersion Include="ProtoTest.Messaging" Version="1.1.5" />
<PackageReference Include="ProtoTest.Messaging" />
paket add ProtoTest.Messaging --version 1.1.5
#r "nuget: ProtoTest.Messaging, 1.1.5"
#:package ProtoTest.Messaging@1.1.5
#addin nuget:?package=ProtoTest.Messaging&version=1.1.5
#tool nuget:?package=ProtoTest.Messaging&version=1.1.5
ProtoTest.Messaging
Publish messages and await events through a shared messaging API.
dotnet add package ProtoTest.Messaging
await Proto.Context.Messaging()
.PublishAsync("invoices-create", """{"id":42}""");
var paid = await Proto.Context.Messaging()
.AwaitAsync("invoice-paid", message => message.Payload.Contains("42"));
Without a broker adapter the package uses an in-memory implementation. Add ProtoTest.Messaging.RabbitMq when the test must communicate with RabbitMQ.
A consumed message reads typed: message.ReadRequired<T>() (or ReadAsJson<T>() for a nullable read) uses the shared JSON defaults, and ReadRequired<T>("$.id") reads one path.
A publish and an await can name a routing key, and an await can name a queue directly with ProtoDestination.Queue(...) for dead-letter queues. Both are transport concerns; see the messaging docs for which broker supports what.
Declare the destinations a test awaits in code with Tap, and the destinations the suite owns (the ones it publishes to itself) with Declare, so the adapter binds its taps and creates the suite's topology before the act publishes:
builder.AddMessaging(messaging => messaging
.CaptureAttachments()
.Declare("invoice-paid")
.Tap("invoice-paid")
.UseRabbitMq());
Repeated calls compose, and Declare is idempotent: the destination is created once per run during setup. The in-memory broker treats it as a no-op, because every destination already exists there.
Publishing, waiting and matched payloads can be traced and captured as attachments.
Learn more
| Product | Versions 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. |
-
net10.0
- ProtoTest.Core (>= 1.1.5)
- ProtoTest.Json (>= 1.1.5)
-
net8.0
- ProtoTest.Core (>= 1.1.5)
- ProtoTest.Json (>= 1.1.5)
-
net9.0
- ProtoTest.Core (>= 1.1.5)
- ProtoTest.Json (>= 1.1.5)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ProtoTest.Messaging:
| Package | Downloads |
|---|---|
|
ProtoTest.Messaging.RabbitMq
RabbitMQ adapter for the ProtoTest messaging capability: publish to exchanges and tap events with a per-test queue. |
|
|
ProtoTest.Messaging.MassTransit
MassTransit bridge for the ProtoTest messaging capability: publish and await messages over the application's in-process ITestHarness. |
GitHub repositories
This package is not used by any popular GitHub repositories.