public void Should_have_received_b() { var message = new B(); RemoteBus.Publish(message); TestConsumerBase <B> .OnlyOneShouldHaveReceivedMessage(message, 8.Seconds()); }
public void Should_have_received_a() { var message = new A(); LocalBus.Publish(message); TestConsumerBase <A> .OnlyOneShouldHaveReceivedMessage(message, 8.Seconds()); }
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); }
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); }
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); }
public ConsumerOfAAndB() { _consumerA = new TestConsumerBase <A>(); _consumerB = new TestConsumerBase <B>(); }