public void When_a_cancel_has_been_signaled_then_IsCanceled_returns_true() { var failed = new CommandFailed(new ScheduledCommand<NonEventSourcedCommandTarget>(new TestCommand(), Any.Guid())); failed.Cancel(); failed.IsCanceled .Should() .BeTrue(); }
public void When_a_cancel_has_been_signaled_then_IsCanceled_returns_true() { var failed = new CommandFailed(new ScheduledCommand <NonEventSourcedCommandTarget>(new TestCommand(), Any.Guid())); failed.Cancel(); failed.IsCanceled .Should() .BeTrue(); }
public async Task HandleScheduledCommandException(Order order, CommandFailed <Ship> command) { if (command.Exception is CommandValidationException) { if (order.IsCancelled) { order.RecordEvent(new ShipmentCancelled()); } if (order.IsShipped) { command.Cancel(); } } }