Пример #1
0
        public async Task UpdateStorageQueue()
        {
            //create storage queue
            string       storageQueueName = Recording.GenerateAssetName("testqueue");
            StorageQueue queue1           = (await _storageQueueContainer.CreateOrUpdateAsync(storageQueueName, new StorageQueueData())).Value;

            Assert.IsNotNull(queue1);
            Assert.AreEqual(queue1.Id.Name, storageQueueName);

            //update queue's meta data
            StorageQueueData queueData = new StorageQueueData();

            queueData.Metadata.Add("key1", "value1");
            queueData.Metadata.Add("key2", "value2");
            StorageQueue queue2 = await queue1.UpdateAsync(queueData);

            //validate
            Assert.NotNull(queue2);
            Assert.NotNull(queue2.Data.Metadata);
            Assert.AreEqual(queue2.Data.Metadata["key1"], "value1");
            Assert.AreEqual(queue2.Data.Metadata["key2"], "value2");
        }