private async Task DownloadLayout(Stream targetStream) { var fileNames = await layoutsContainer.ListFiles(); var layoutName = fileNames[Random.Range(0, fileNames.Count)]; await layoutsContainer.DownloadFile(layoutName, targetStream); }
public async Task TestFiles() { CloudBlobContainer container = _blobClient.GetContainerReference("container"); container.CreateIfNotExists(); await Task.WhenAll( CreateEmptyBlob(container.GetBlockBlobReference("blob1")), CreateEmptyBlob(container.GetBlockBlobReference("blob2"))); AzureBlobContainer azureBlobContainer = new AzureBlobContainer(container); IEnumerable <string> files = (await azureBlobContainer.ListFiles()).Select(d => d.Name); Assert.AreEqual(2, files.Count()); Assert.IsTrue(files.Contains("blob1")); Assert.IsTrue(files.Contains("blob2")); }