public void Initialize(Configuration configuration) { configuration.IsUsingCommandSchedulerPipeline(true); configuration.SubscribeCommandSchedulerToEventBusFor <TAggregate>() .AddToCommandSchedulerPipeline( CommandScheduler.WithInMemoryDeferredScheduling <TAggregate>(configuration)) .TraceCommandsFor <TAggregate>(); }
public void If_Schedule_is_dependent_on_an_event_with_no_aggregate_id_then_it_throws() { var scheduler = new CommandScheduler<CustomerAccount>( new InMemoryEventSourcedRepository<CustomerAccount>(), new InMemoryCommandPreconditionVerifier()); Action schedule = () => scheduler.Schedule( Any.Guid(), new SendOrderConfirmationEmail(Any.Word()), deliveryDependsOn: new Order.Created { AggregateId = Guid.Empty, ETag = Any.Word() }).Wait(); schedule.ShouldThrow<ArgumentException>() .And .Message .Should() .Contain("An AggregateId must be set on the event on which the scheduled command depends."); }