public async Task List() { #region Snippet:Managing_ServiceBusQueues_ListQueues await foreach (ServiceBusQueueResource serviceBusQueue in serviceBusQueueCollection.GetAllAsync()) { Console.WriteLine(serviceBusQueue.Id.Name); } #endregion }
public async Task GetAllQueues() { IgnoreTestInLiveMode(); //create ten queues for (int i = 0; i < 10; i++) { string queueName = Recording.GenerateAssetName("queue" + i.ToString()); _ = await _queueCollection.CreateOrUpdateAsync(WaitUntil.Completed, queueName, new ServiceBusQueueData()); } //validate List <ServiceBusQueue> list = await _queueCollection.GetAllAsync().ToEnumerableAsync(); Assert.AreEqual(10, list.Count); list = await _queueCollection.GetAllAsync(5, 5).ToEnumerableAsync(); Assert.AreEqual(5, list.Count); }