Adds Verify support for verifying Brighter.
See Milestones for release notes.
https://nuget.org/packages/Verify.Brighter/
[ModuleInitializer]
public static void Init() =>
VerifyBrighter.Initialize();
Given the handler:
public class Handler(IAmACommandProcessor processor) :
RequestHandlerAsync<Message>
{
public override async Task<Message> HandleAsync(
Message message,
Cancel cancel = default)
{
await processor.SendAsync(new MyCommand("Some data"));
await processor.PublishAsync(new MyEvent("Some other data"));
return await base.HandleAsync(message);
}
}
Pass in instance of RecordingMessageContext
in to the Handle
method and then Verify
that instance.
[Fact]
public async Task HandlerTest()
{
var context = new RecordingCommandProcessor();
var handler = new Handler(context);
await handler.HandleAsync(new Message("value"));
await Verify(context);
}
Will result in:
{
Send: MyCommand: {
Property: Some data
},
Publish: MyEvent: {
Property: Some other data
}
}
Cannon from The Noun Project.