public async Task DeleteMessageAsync_NonexistentMessage_ThrowsMessageNotFoundException() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); await client.DeleteMessageAsync(queueName, "abc-123", FakePopReceipt); // expects exception }
public async Task DeleteMessageAsync_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); await client.DeleteMessageAsync(queueName, itemFromQueue.Id, itemFromQueue.PopReceipt); _util.AssertQueueIsEmpty(queueName); }