Ejemplo n.º 1
0
        public async Task CloudTableClientGetAllTablesTest()
        {
            // Act
            List <CloudTable> allTables = await _tableClient.ListTablesAsync();

            // Assert
            Assert.NotNull(allTables);
            Assert.True(_tableNames.All(allTables.Select(p => p.Name).Contains));
        }
Ejemplo n.º 2
0
        public static async Task <IList <CloudTable> > ListTablesAsync(
            this CloudTableClient client,
            CancellationToken ct = default(CancellationToken))
        {
            var tables = new List <CloudTable>();

            TableContinuationToken token = null;

            do
            {
                TableResultSegment seg = await client.ListTablesAsync(token, ct);

                token = seg.ContinuationToken;
                tables.AddRange(seg);
            } while (token != null && !ct.IsCancellationRequested);

            return(tables);
        }