public void When_rejecting_a_message_through_gateway_without_requeue()
        {
            _receiver.Reject(_listenedMessage, false);

            //should_not_requeue_the_message
            Assert.Null(_testQueueListener.Listen());
        }
Exemple #2
0
        public void When_purging_the_queue()
        {
            _sender.Send(_sentMessage);
            _receiver.Purge();

            //should_clean_the_queue
            Assert.Null(_testQueueListener.Listen());
        }
Exemple #3
0
        public void When_posting_a_message_via_the_messaging_gateway()
        {
            _messageProducer.Send(_message);
            _listenedMessage = _queueListener.Listen();

            //should_send_the_message_to_aws_sqs
            Assert.NotNull(_listenedMessage.Body);
        }
Exemple #4
0
        public void When_reading_a_message_via_the_messaging_gateway()
        {
            _sender.Send(_sentMessage);
            _receivedMessage = _receiver.Receive(2000);
            _receiver.Acknowledge(_receivedMessage);


            //should_send_a_message_via_sqs_with_the_matching_body
            Assert.AreEqual(_sentMessage.Body, _receivedMessage.Body);
            //should_send_a_message_via_sqs_with_the_matching_header_handled_count
            Assert.AreEqual(_sentMessage.Header.HandledCount, _receivedMessage.Header.HandledCount);
            //should_send_a_message_via_sqs_with_the_matching_header_id
            Assert.AreEqual(_sentMessage.Header.Id, _receivedMessage.Header.Id);
            //should_send_a_message_via_sqs_with_the_matching_header_message_type
            Assert.AreEqual(_sentMessage.Header.MessageType, _receivedMessage.Header.MessageType);
            //should_send_a_message_via_sqs_with_the_matching_header_time_stamp
            Assert.AreEqual(_sentMessage.Header.TimeStamp, _receivedMessage.Header.TimeStamp);
            //should_send_a_message_via_sqs_with_the_matching_header_topic
            Assert.AreEqual(_sentMessage.Header.Topic, _receivedMessage.Header.Topic);
            //should_remove_the_message_from_the_queue
            Assert.Null(_testQueueListener.Listen());
        }