protected override void Configure(SagaConfiguration saga) { saga.CanStartWith((MoneyTransferSent e) => e.TransferId); saga.CanStartWith((MoneyTransferReceived e) => e.TransferId); saga.CanHandle((MoneyTransferRefunded e) => e.TransferId); saga.CanHandle((MoneyTransferFailed e) => e.TransferId); saga.CanHandle((Timeout e) => e.CorrelationId); }
protected override void Configure(SagaConfiguration saga) { saga.CanStartWith((FakeEvent e) => Guid.Empty); saga.CanStartWith((AlternateFakeEvent e) => Guid.Empty); saga.CanStartWith((DerivedFakeEvent e) => Guid.Empty); saga.CanHandle((Timeout e) => Guid.Empty); }
public void ReturnFalseIfSagaCannotStartWithEventType() { var configuration = new SagaConfiguration(typeof(FakeSaga)); configuration.CanHandle((FakeHandledEvent e) => e.Id); Assert.False(configuration.GetMetadata().CanHandle(typeof(FakeUnhandledEvent))); }
public void EventMarkedAsInitiatingEvent() { var configuration = new SagaConfiguration(typeof(FakeSaga)); configuration.CanHandle((FakeEvent e) => e.Id); Assert.True(configuration.GetMetadata().CanHandle(typeof(FakeEvent))); }
public WhenGettingEventCorrelationId() { var configuration = new SagaConfiguration(typeof(FakeSaga)); configuration.CanStartWith((FakeInitiatingEvent e) => e.Id); configuration.CanHandle((FakeHandledEvent e) => e.Id); sagaMetadata = configuration.GetMetadata(); }
public void CanRegisterEventTypeOnlyOnce() { var configuration = new SagaConfiguration(typeof(FakeSaga)); configuration.CanStartWith((FakeEvent e) => e.Id); Assert.Equal( Exceptions.EventTypeAlreadyConfigured.FormatWith(typeof(FakeSaga), typeof(FakeEvent)), Assert.Throws <ArgumentException>(() => configuration.CanHandle((FakeEvent e) => e.Id)).Message ); }
public void CanRegisterEventTypeOnlyOnce() { var configuration = new SagaConfiguration(typeof(FakeSaga)); configuration.CanStartWith((FakeEvent e) => e.Id); Assert.Equal( Exceptions.EventTypeAlreadyConfigured.FormatWith(typeof(FakeSaga), typeof(FakeEvent)), Assert.Throws<ArgumentException>(() => configuration.CanHandle((FakeEvent e) => e.Id)).Message ); }
protected override void Configure(SagaConfiguration saga) { saga.CanStartWith(((FakeInitiatingEvent e) => e.Id)); saga.CanHandle(((FakeHandledEvent e) => e.Id)); }
protected override void Configure(SagaConfiguration saga) { saga.CanStartWith((FakeEvent e) => e.Id); saga.CanHandle((Timeout e) => e.CorrelationId); }
protected override void Configure(SagaConfiguration saga) { saga.CanHandle((FakeEvent e) => e.Id); }
public void ResolverCannotBeNull() { var configuration = new SagaConfiguration(typeof(FakeSaga)); Assert.Throws<ArgumentNullException>(() => configuration.CanHandle(default(Func<FakeEvent, Guid>))); }
public void ResolverCannotBeNull() { var configuration = new SagaConfiguration(typeof(FakeSaga)); Assert.Throws <ArgumentNullException>(() => configuration.CanHandle(default(Func <FakeEvent, Guid>))); }