public async Task GivenANotExistingDirectoryName_WhenListPaths_NoPathShouldBeReturned()
        {
            var uniqueContainerName             = Guid.NewGuid().ToString("N");
            AzureBlobContainerClient adlsClient = GetTestAdlsGen2Client(uniqueContainerName);

            Skip.If(adlsClient == null);

            var blobContainerClient = GetBlobContainerClient(uniqueContainerName);

            blobContainerClient.CreateIfNotExists();

            try
            {
                var paths = new List <PathItem>();
                await foreach (var item in adlsClient.ListPathsAsync(uniqueContainerName))
                {
                    paths.Add(item);
                }

                Assert.Empty(paths);
            }
            finally
            {
                await blobContainerClient.DeleteAsync();
            }
        }
        public async Task GivenAValidDirectoryName_WhenListPaths_AllPathsShouldBeReturned()
        {
            var uniqueContainerName             = Guid.NewGuid().ToString("N");
            AzureBlobContainerClient adlsClient = GetTestAdlsGen2Client(uniqueContainerName);

            Skip.If(adlsClient == null);

            var blobContainerClient = GetBlobContainerClient(uniqueContainerName);

            blobContainerClient.CreateIfNotExists();

            try
            {
                // Set up directory info
                var blobList = new List <string> {
                    "foo/bar/1.txt", "foo/bar1/1.txt", "foo/bar2/2.txt", "foo/bar2/2.1.txt", "foo/bar3/3.txt"
                };
                var expectedResult = new HashSet <string> {
                    "foo/bar", "foo/bar1", "foo/bar2", "foo/bar3", "foo/bar/1.txt", "foo/bar1/1.txt", "foo/bar2/2.txt", "foo/bar2/2.1.txt", "foo/bar3/3.txt"
                };
                foreach (var blob in blobList)
                {
                    await blobContainerClient.UploadBlobAsync(blob, new MemoryStream(new byte[] { 1, 2, 3 }));
                }

                var paths = new List <PathItem>();
                await foreach (var item in adlsClient.ListPathsAsync("foo"))
                {
                    paths.Add(item);
                }

                Assert.Equal(expectedResult, paths.Select(x => x.Name).ToHashSet());
            }
            finally
            {
                await blobContainerClient.DeleteAsync();
            }
        }