Test your hypothesis easily with a ServiceBusProcessor.
License
—
Deps
2
Install Size
—
Vulns
✓ 0
Published
Dec 10, 2024
$ dotnet add package Hypothesist.ServiceBusEasily test your ServiceBus integration by hooking up your hypothesis test into a service bus processor and receiver.
// Arrange
var hypothesis = Hypothesis
.For<ServiceBusReceivedMessage>()
.Any(m => m.Body.ToString() == "data");
await using var client = new ServiceBusClient(..., new DefaultAzureCredential());
await using var processor = await client.CreateProcessor(...).Test(hypothesis);
// Act
await sut.Something(); // publish something to servicebus
// Assert
await hypothesis.Validate(10.Seconds());
and for the receiver:
await using var receiver = await client.CreateReceiver(...).Test(hypothesis);
Checkout the docs to get a better understanding of what hypothesist can do for you.