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.
// Arrange
var hypothesis = Hypothesis
.For<ServiceBusReceivedMessage>()
.Any(m => m.Body.ToString() == "data");
await using var client = new ServiceBusClient("...", new DefaultAzureCredential());
await using var processor = client.CreateProcessor("...");
await processor.Test(hypothesis);
// Act
await sut.Something(); // publishes something to ServiceBus
// Assert
await hypothesis.Validate(10.Seconds());
Checkout the docs to get a better understanding of what hypothesist can do for you.