public void DeleteMessage_NonexistentMessage_ThrowsMessageNotFoundException() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); client.DeleteMessage(queueName, "abc-123", FakePopReceipt); // expects exception }
public void DeleteMessage_BadlyFormattedPopReceipt_ThrowsInvalidQueryParameterException() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); client.DeleteMessage(queueName, "abc-123", "bad format"); // expects exception }
public void DeleteMessage_ValidMessage_DeletesItFromTheQueue() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); _util.AddItemsToQueue(queueName, new List<string>() { "1" }); var itemFromQueue = _util.GetItemFromQueue(queueName); client.DeleteMessage(queueName, itemFromQueue.Id, itemFromQueue.PopReceipt); _util.AssertQueueIsEmpty(queueName); }