public void SetQueueMetadata_ValidMetadata_SetsMetadataOnQueue() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); var expectedMetadata = new Dictionary<string, string>(){ {"one", "1"}, {"two", "2"} }; client.SetQueueMetadata(queueName, expectedMetadata); var metadata = _util.GetQueueMetadata(queueName); Assert.IsNotNull(metadata); Assert.AreEqual(expectedMetadata.Count, metadata.Count); foreach (var key in expectedMetadata.Keys) { Assert.AreEqual(expectedMetadata[key], metadata[key]); } }
public void SetQueueMetadata_NonexistentQueue_ThrowsQueueDoesNotExistException() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); client.SetQueueMetadata(queueName, new Dictionary<string, string>()); // expects exception }
public void SetQueueMetadata_EmptyMetadata_SetsEmptyMetadataOnQueue() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); client.SetQueueMetadata(queueName, new Dictionary<string, string>()); var metadata = _util.GetQueueMetadata(queueName); Assert.IsEmpty(metadata); }