public async Task WhenCommandIsExecutedThenCommandIsPassedToTheHandler() { var command = new CommandWithoutResult(); var result = await _commandBus.ExecuteAsync(command); Assert.True(result.WasSuccessful); Assert.True(command.WasHandled); }
public static async Task Run() { ICommandDispatcher dispatcher = Configure(); CommandWithoutResult command = new CommandWithoutResult { DoSomething = "Hello" }; await dispatcher.DispatchAsync(command); await dispatcher.DispatchAsync(command); Console.WriteLine("\nPress a key to continue..."); }