示例#1
0
        public void ExpectTimeoutFails()
        {
            var saga      = new TestSaga();
            var executeOn = 31.January(2019).At(10, 35).AsLocal();

            Test.Saga(saga)
            .ExpectTimeoutToBeSetAt <TimeoutData>((state, time) => time == executeOn)
            .When((s, c) => s.Handle(new StartSagaCommand {
                Id = new Guid("22222222-2222-2222-2222-222222222222"), ExecutionTime = executeOn
            }, c));
        }
示例#2
0
        public async Task ExpectTimeoutFails_WithNewTestingFramework()
        {
            var saga = new TestSaga {
                Data = new MySagaData {
                    Id = new Guid("11111111-1111-1111-1111-111111111111")
                }
            };
            var executeOn = 31.January(2019).At(10, 35).AsLocal();

            var context = new TestableMessageHandlerContext();
            await saga.Handle(new StartSagaCommand { Id = new Guid("22222222-2222-2222-2222-222222222222"), ExecutionTime = executeOn }, context).ConfigureAwait(false);

            var sentMessage = context.SentMessages.SingleOrDefault();

            sentMessage.Message <TimeoutData>().Time.Should().Be(executeOn);
        }