public void When_reading_a_message_from_a_channel_with_multiple_topics() { _messageProducer.Send(_messageTopic1); _messageProducer.Send(_messageTopic2); var topic1Result = _client.Listen(suppressDisposal: true); var topic2Result = _client.Listen(); // should_received_a_message_from_test1_with_same_topic_and_body topic1Result.RoutingKey.Should().Be(_messageTopic1.Header.Topic); topic1Result.Body.Should().BeEquivalentTo(_messageTopic1.Body.Value); // should_received_a_message_from_test2_with_same_topic_and_body topic2Result.RoutingKey.Should().Be(_messageTopic2.Header.Topic); topic2Result.Body.Should().BeEquivalentTo(_messageTopic2.Body.Value); }
public void When_reading_a_delayed_message_via_the_messaging_gateway() { _messageProducer.SendWithDelay(_message, 1000); var immediateResult = _client.Listen(0, true); _immediateReadIsNull = immediateResult == null; var delayedResult = _client.Listen(2000); _messageBody = delayedResult.GetBody(); _messageHeaders = delayedResult.GetHeaders(); //_should_have_not_been_able_get_message_before_delay _immediateReadIsNull.Should().BeTrue(); //_should_send_a_message_via_rmq_with_the_matching_body _messageBody.Should().Be(_message.Body.Value); //_should_send_a_message_via_rmq_with_delay_header _messageHeaders.Keys.Should().Contain(HeaderNames.DELAY_MILLISECONDS); //_should_received_a_message_via_rmq_with_delayed_header _messageHeaders.Keys.Should().Contain(HeaderNames.DELAYED_MILLISECONDS); }
public void When_posting_a_message_via_the_messaging_gateway() { _messageProducer.Send(_message); var result = _client.Listen(); _messageBody = result.GetBody(); _messageHeaders = result.GetHeaders(); //_should_send_a_message_via_rmq_with_the_matching_body _messageBody.Should().Be(_message.Body.Value); //_should_send_a_message_via_rmq_without_delay_header _messageHeaders.Keys.Should().NotContain(HeaderNames.DELAY_MILLISECONDS); //_should_received_a_message_via_rmq_without_delayed_header _messageHeaders.Keys.Should().NotContain(HeaderNames.DELAYED_MILLISECONDS); }