예제 #1
0
        public void Should_process_the_messages_in_order_and_not_at_the_same_time()
        {
            Guid transactionId = NewId.NextGuid();

            Trace.WriteLine("Creating transaction for " + transactionId);

            int startValue = 1;

            var startConcurrentSaga = new StartConcurrentSaga
            {
                CorrelationId = transactionId, Name = "Chris", Value = startValue
            };

            LocalBus.Publish(startConcurrentSaga);
            LocalBus.Publish(startConcurrentSaga);
            Trace.WriteLine("Just published the start message");

            _sagaRepository.ShouldContainSaga(transactionId).ShouldNotBeNull();

            int nextValue = 2;
            var continueConcurrentSaga = new ContinueConcurrentSaga {
                CorrelationId = transactionId, Value = nextValue
            };

            LocalBus.Publish(continueConcurrentSaga);
            Trace.WriteLine("Just published the continue message");

            _sagaRepository.ShouldContainSaga(x => x.CorrelationId == transactionId && x.Value == nextValue).
            ShouldNotBeNull();

            Thread.Sleep(8000);

            LocalEndpoint.ShouldNotContain <StartConcurrentSaga>();
            LocalErrorEndpoint.ShouldContain <StartConcurrentSaga>();
        }
        public void The_message_should_not_exist_in_the_input_queue()
        {
            _future.IsAvailable(3.Seconds())
            .ShouldBeTrue();

            LocalEndpoint.ShouldNotContain(_ping);
        }
 public void The_message_should_not_exist_in_the_input_queue()
 {
     LocalEndpoint.ShouldNotContain(_ping);
 }
예제 #4
0
 public void The_message_should_not_exist_in_the_input_queue()
 {
     LocalEndpoint.ShouldNotContain(_ping);
     // it can pass because of infinite processing loop, however endpoint contains ping message
 }