예제 #1
0
            public void CannotScheduleTimeoutIfTimeoutNotHandled()
            {
                var saga = new FakeSagaWithoutTimeout()
                {
                    CorrelationId = GuidStrategy.NewGuid()
                };
                var e = new FakeEvent();

                using (var context = new SagaContext(saga.GetType(), GuidStrategy.NewGuid(), e))
                {
                    var ex = Assert.Throws <InvalidOperationException>(() => saga.Handle(e));

                    Assert.Equal(Exceptions.SagaTimeoutNotHandled.FormatWith(saga.GetType()), ex.Message);
                    Assert.False(context.TimeoutChanged);
                }
            }
예제 #2
0
            public void CannotScheduleTimeoutIfTimeoutNotHandled()
            {
                var saga = new FakeSagaWithoutTimeout() { CorrelationId = GuidStrategy.NewGuid() };
                var e = new FakeEvent();

                using (var context = new SagaContext(saga.GetType(), GuidStrategy.NewGuid(), e))
                {
                    var ex = Assert.Throws<InvalidOperationException>(() => saga.Handle(e));

                    Assert.Equal(Exceptions.SagaTimeoutNotHandled.FormatWith(saga.GetType()), ex.Message);
                    Assert.False(context.TimeoutChanged);
                }
            }