public void Should_mark_the_message_as_acked()
        {
            var message = CreateTestMessage();

            Store(message);

            byte[] msg;

            IDictionary <string, string> headers;

            Persister.AckMessage(message.ClientId, out msg, out headers);

            Assert.True(GetStoredMessage(message.ClientId).Acknowledged);
        }
예제 #2
0
        public void The_ack_should_return_false_to_indicate_that_the_message_has_already_been_acked()
        {
            var message = CreateTestMessage();

            Store(message);

            byte[] msg;

            IDictionary <string, string> headers;

            Persister.AckMessage(message.ClientId, out msg, out headers);

            Assert.False(Persister.AckMessage(message.ClientId, out msg, out headers));
        }
        public void Should_return_the_message_and_headers()
        {
            var message = CreateTestMessage();

            Store(message);

            byte[] msg;

            IDictionary <string, string> headers;

            using (var tx = new TransactionScope())
            {
                Persister.AckMessage(message.ClientId, out msg, out headers);
                tx.Complete();
            }

            Assert.AreEqual(message.Headers, headers);
            Assert.AreEqual(message.OriginalMessage, msg);
        }