当前位置: 首页>>代码示例>>C#>>正文


C# QueueServiceClient.ListQueues方法代码示例

本文整理汇总了C#中QueueServiceClient.ListQueues方法的典型用法代码示例。如果您正苦于以下问题:C# QueueServiceClient.ListQueues方法的具体用法?C# QueueServiceClient.ListQueues怎么用?C# QueueServiceClient.ListQueues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueueServiceClient的用法示例。


在下文中一共展示了QueueServiceClient.ListQueues方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ListQueues_AtLeastOneQueue_ReturnsListContainingThatQueue

        public void ListQueues_AtLeastOneQueue_ReturnsListContainingThatQueue()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName);

            var response = client.ListQueues();

            Assert.IsTrue(response.Queues.Any(q => q.Name == queueName));
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:10,代码来源:AccountOperationsTests.cs

示例2: ListQueues_WithPrefix_ReturnsListContainingOnlyQueuesWithThatPrefix

        public void ListQueues_WithPrefix_ReturnsListContainingOnlyQueuesWithThatPrefix()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueNames = new List<string>();
            for (int i = 18; i < 21; i++)
            {
                var queueName = GenerateSampleQueueName(i.ToString());
                _util.CreateQueue(queueName);
                queueNames.Add(queueName);
            }

            var response = client.ListQueues("1");

            Assert.AreEqual("1", response.Prefix);
            Assert.IsTrue(response.Queues.Count(q => q.Name.StartsWith("1")) >= 2);
            Assert.AreEqual(0, response.Queues.Count(q => !q.Name.StartsWith("1")));
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:17,代码来源:AccountOperationsTests.cs

示例3: ListQueues_WithContinuationMarker_ReturnsRemainderOfList

        public void ListQueues_WithContinuationMarker_ReturnsRemainderOfList()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueNames = new List<string>();
            for (int i = 0; i < 5; i++)
            {
                var queueName = GenerateSampleQueueName(i.ToString());
                _util.CreateQueue(queueName);
                queueNames.Add(queueName);
            }
            var response = client.ListQueues(maxResults: 3);

            var response2 = client.ListQueues(marker: response.Marker);

            Assert.IsNotEmpty(response2.Queues);
            Assert.GreaterOrEqual(response2.Queues.Count, 2);
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:17,代码来源:AccountOperationsTests.cs

示例4: ListQueues_MaxResultsSmallerThanQueueList_ReturnsOnlyThatManyResults

        public void ListQueues_MaxResultsSmallerThanQueueList_ReturnsOnlyThatManyResults()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueNames = new List<string>();
            for (int i = 0; i < 5; i++)
            {
                var queueName = GenerateSampleQueueName(i.ToString());
                _util.CreateQueue(queueName);
                queueNames.Add(queueName);
            }

            var response = client.ListQueues(maxResults: 3);

            Assert.AreEqual(3, response.Queues.Count);
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:15,代码来源:AccountOperationsTests.cs

示例5: ListQueues_IncludingMetadata_ReturnsQueuesWithMetadata

        public void ListQueues_IncludingMetadata_ReturnsQueuesWithMetadata()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName, new Dictionary<string, string>() { 
                {"a", "1"},
                {"b", "2"}
            });

            var response = client.ListQueues(includeMetadata: true);

            Assert.IsTrue(response.Queues.Any(q => q.Name == queueName));
            var queue = response.Queues.Where(q => q.Name == queueName).Single();
            Assert.IsNotEmpty(queue.Metadata);
            Assert.AreEqual("1", queue.Metadata["a"]);
            Assert.AreEqual("2", queue.Metadata["b"]);
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:17,代码来源:AccountOperationsTests.cs


注:本文中的QueueServiceClient.ListQueues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。