예제 #1
0
        public void IgnoresAutoCorrelationWhenCorrelationIsExplicitlySetUp(bool abandonReply)
        {
            // arrange
            var anotherSaga = new AnotherSaga(sagaBus, abandonReply);

            sagaHandlerActivator.UseHandler(anotherSaga);

            serviceHandlerActivator.Handle <RequestWithCorrelationId>(req => serviceBus.Reply(new ReplyWithCorrelationId {
                Correlationid = req.Correlationid
            }));

            // act
            initiatorBus.Send(new InitiateRequestReply());
            Thread.Sleep(3.Seconds());

            // assert
            sagaPersister.Count().ShouldBe(1);
            var sagaData = sagaPersister.Single();

            sagaData.ShouldBeTypeOf <SomeSagaData>();
            ((SomeSagaData)sagaData).GotTheReply.ShouldBe(!abandonReply);
        }