Skip to content

Instantly share code, notes, and snippets.

@mxmissile
Created August 14, 2023 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxmissile/3e341ec345e17337b0a8674ecaf69c78 to your computer and use it in GitHub Desktop.
Save mxmissile/3e341ec345e17337b0a8674ecaf69c78 to your computer and use it in GitHub Desktop.
[TestClass]
public class WolverineTests
{
[TestMethod]
public async Task cascade_test()
{
using var host = await Host.CreateDefaultBuilder()
.UseWolverine((context, opts) => { })
.StartAsync();
var bus = host.Services.GetRequiredService<IMessageBus>();
await bus.InvokeAsync(new CascadeCommand());
}
}
public record CascadeCommand;
public record Step1Result;
public record Step2Result;
public record Step3Result;
public class Step1Handler
{
public Step1Result Consume(CascadeCommand cmd)
{
Console.WriteLine("handle step 1");
return new Step1Result();
}
}
public class Step2Handler
{
public Step2Result Consume(Step1Result cmd)
{
Console.WriteLine("handle step 2");
return new Step2Result();
}
}
public class Step3Handler
{
public Step3Result Consume(Step2Result cmd)
{
Console.WriteLine("handle step 3");
return new Step3Result();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment