public void Can_delete_message_from_queue() { var sqs = new InMemorySqsClient(); sqs.CreateQueue(new SqsQueueName("bar")); sqs.SendMessage(new SqsQueueName("bar"), "msg body"); var receivedMessages = sqs.ReceiveMessages(new SqsQueueName("bar"), 0.Seconds(), 10).First(); sqs.DeleteMessage(new SqsQueueName("bar"), receivedMessages.MessageReceipt); var remainingMessages = sqs.ReceiveMessages(new SqsQueueName("bar"), 0.Seconds(), 10); Assert.IsFalse(remainingMessages.Any()); }
public void Can_round_trip_message_through_queue() { var sqs = new InMemorySqsClient(); var queueName = new SqsQueueName("bar"); sqs.CreateQueue(queueName); sqs.SendMessage(queueName, "msg body"); var messages = sqs.ReceiveMessages(queueName, 0.Seconds(), 10); Assert.AreEqual(1, messages.Count()); var received = messages.First(); Assert.AreEqual("msg body", received.Body); }
public void Can_create_and_delete_queues() { var sqs = new InMemorySqsClient(); var queueName = new SqsQueueName("bar"); sqs.CreateQueue(queueName); var queues = sqs.ListQueues(null); Assert.AreEqual(1, queues.Count()); Assert.AreEqual("bar", queues.First()); sqs.DeleteQueue(queueName); queues = sqs.ListQueues(null); Assert.IsFalse(queues.Any()); }
public void Delete_failure_throws() { var sqs = new InMemorySqsClient(); sqs.DeleteMessage(new SqsQueueName("non-existant"), new SqsMessageReceipt("msg receipt")); }
public void Sending_to_non_existent_queue_sets_exception_in_result() { var sqs = new InMemorySqsClient(); sqs.SendMessage(new SqsQueueName("foo"), "msg body"); }
public void Cannot_sent_a_message_to_a_non_existent_queue() { var sqs = new InMemorySqsClient(); sqs.SendMessage(new SqsQueueName("myqueuename"), "message body"); }
public void Receiving_from_non_existent_queue_throws() { var sqs = new InMemorySqsClient(); sqs.ReceiveMessages(new SqsQueueName("foo"), 0.Seconds(), 10); }
public void Cannot_receive_a_message_to_a_non_existent_queue() { var sqs = new InMemorySqsClient(); sqs.ReceiveMessages(new SqsQueueName("queuename"), 0.Seconds(), 10); }