本文整理汇总了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));
}
示例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")));
}
示例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);
}
示例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);
}
示例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"]);
}