Exemple #1
0
        public void Deleting_from_non_existent_q_throws_exception()
        {
            var entries  = 1.Times(() => new DeleteMessageBatchRequestEntry());
            var queueUrl = $"http://{Guid.NewGuid():N}.com";

            SqsTestAssert.Throws <QueueDoesNotExistException>(() =>
                                                              client.DeleteMessageBatch(new DeleteMessageBatchRequest(queueUrl, entries)),
                                                              "specified queue does not exist");
        }
        public void Qd_does_not_return_for_non_existent_queue_that_is_already_cached_when_forced()
        {
            var qd = sqsQueueManager.CreateQueue(GetNewId());

            var returnedQd = sqsQueueManager.GetQueueDefinition(qd.QueueName);

            Assert.IsTrue(ReferenceEquals(qd, returnedQd));

            // delete q directly at the client
            Assert.IsNotNull(sqsQueueManager.SqsClient.DeleteQueue(new DeleteQueueRequest(qd.QueueUrl)));

            // should still be in the cache
            Assert.IsTrue(sqsQueueManager.QueueNameMap.ContainsKey(qd.QueueName));

            // should still return true when not forced, false when forced
            Assert.IsNotNull(sqsQueueManager.GetQueueDefinition(qd.QueueName));

            SqsTestAssert.Throws <QueueDoesNotExistException>(() => sqsQueueManager.GetQueueDefinition(qd.QueueName, forceRecheck: true), "specified queue does not exist");
        }
Exemple #3
0
        public void Sending_to_non_existent_q_throws_exception()
        {
            var queueUrl = $"http://{Guid.NewGuid():N}.com";

            SqsTestAssert.Throws <QueueDoesNotExistException>(() => helper.SendMessages(queueUrl), "specified queue does not exist");
        }