예제 #1
0
        public void Should_have_received_b()
        {
            var message = new B();

            RemoteBus.Publish(message);

            TestConsumerBase <B> .OnlyOneShouldHaveReceivedMessage(message, 8.Seconds());
        }
예제 #2
0
        public void Should_have_received_a()
        {
            var message = new A();

            LocalBus.Publish(message);

            TestConsumerBase <A> .OnlyOneShouldHaveReceivedMessage(message, 8.Seconds());
        }
예제 #3
0
        public void It_should_be_received_by_a_component()
        {
            RemoteBus.SubscribeConsumer <TestMessageConsumer <PingMessage> >();

            LocalBus.ShouldHaveSubscriptionFor <PingMessage>();

            var message = new PingMessage();

            LocalBus.Publish(message);

            TestConsumerBase <PingMessage> .AnyShouldHaveReceivedMessage(message, _timeout);
        }
        public void It_should_be_received_by_a_component()
        {
            ObjectBuilder.Stub(x => x.GetInstance <TestMessageConsumer <PingMessage> >()).Return(new TestMessageConsumer <PingMessage>());

            RemoteBus.Subscribe <TestMessageConsumer <PingMessage> >();

            PingMessage message = new PingMessage();

            LocalBus.Publish(message);

            TestConsumerBase <PingMessage> .AnyShouldHaveReceivedMessage(message, _timeout);
        }
예제 #5
0
        public void A_reply_should_be_received_by_the_requestor()
        {
            RemoteBus.ShouldHaveRemoteSubscriptionFor <PingMessage>();
            LocalBus.ShouldHaveRemoteSubscriptionFor <PingMessage>();

            var message = new PingMessage();

            var consumer = new TestCorrelatedConsumer <PongMessage, Guid>(message.CorrelationId);

            LocalBus.SubscribeInstance(consumer);

            RemoteBus.ShouldHaveRemoteSubscriptionFor <PongMessage>();

            LocalBus.Publish(message);

            TestConsumerBase <PingMessage> .AnyShouldHaveReceivedMessage(message, _timeout);

            consumer.ShouldHaveReceivedMessage(new PongMessage(message.CorrelationId), _timeout);
        }
예제 #6
0
        public void A_reply_should_be_received_by_the_requestor()
        {
            ObjectBuilder.Stub(x => x.GetInstance <TestReplyService <PingMessage, Guid, PongMessage> >())
            .Return(new TestReplyService <PingMessage, Guid, PongMessage> {
                Bus = RemoteBus
            });

            RemoteBus.Subscribe <TestReplyService <PingMessage, Guid, PongMessage> >();

            PingMessage message = new PingMessage();

            TestCorrelatedConsumer <PongMessage, Guid> consumer = new TestCorrelatedConsumer <PongMessage, Guid>(message.CorrelationId);

            LocalBus.Subscribe(consumer);

            LocalBus.Publish(message);

            TestConsumerBase <PingMessage> .AnyShouldHaveReceivedMessage(message, _timeout);

            consumer.ShouldHaveReceivedMessage(new PongMessage(message.CorrelationId), _timeout);
        }
예제 #7
0
 public ConsumerOfAAndB()
 {
     _consumerA = new TestConsumerBase <A>();
     _consumerB = new TestConsumerBase <B>();
 }