示例#1
0
        public async Task DesktopStorageContainerCreateDirectory()
        {
            // Arrange
            string            dirName   = "CreateDirectory";
            IStorage          storage   = new FileSystemStorage(this._storagePath);
            IStorageContainer container = await storage.GetContainerAsync(DesktopStorageContainerTests._precreatedContainerName);

            // Act
            IEnumerable <string> initialDirs = await container.GetDirectoriesAsync("");

            await container.CreateDirectoryAsync(dirName);

            IEnumerable <string> finalDirs = await container.GetDirectoriesAsync("");

            // Assert
            Assert.False(initialDirs.Any(d => string.Equals(d, dirName, StringComparison.OrdinalIgnoreCase)));
            Assert.True(finalDirs.Any(d => string.Equals(d, dirName, StringComparison.OrdinalIgnoreCase)));
        }