Ejemplo n.º 1
0
        public void non_persistent_messages_should_not_be_sent_to_persistence_peer()
        {
            var message = new FakeNonPersistentCommand(123).ToTransportMessage();

            Transport.Send(message, new[] { AnotherPersistentPeer });

            InnerTransport.ExpectExactly(new TransportMessageSent(message, new[] { AnotherPersistentPeer }));
        }
Ejemplo n.º 2
0
        public void should_throw_when_sending_a_transient_command_to_a_non_responding_peer()
        {
            var command = new FakeNonPersistentCommand(456);
            var peer = new Peer(new PeerId("Abc.Testing.Peer1"), "Peer1Endpoint", true, isResponding: false);
            SetupPeersHandlingMessage<FakeNonPersistentCommand>(new[] { peer });

            _bus.Start();

            Assert.Throws<InvalidOperationException>(() => _bus.Send(command));
        }
Ejemplo n.º 3
0
        public void should_not_publish_a_MessageHandled_event_after_a_non_persistent_message_is_processed_by_the_bus()
        {
            Transport.Start();

            using (MessageId.PauseIdGeneration())
            {
                var command = new FakeNonPersistentCommand(123).ToTransportMessage();
                InnerTransport.RaiseMessageReceived(new ReplayPhaseEnded(StartMessageReplayCommand.ReplayId).ToTransportMessage());

                InnerTransport.RaiseMessageReceived(command);
                Transport.AckMessage(command);

                InnerTransport.ExpectNothing();
            }
        }