예제 #1
0
        public async Task DesktopStorageGetListOfContainers()
        {
            // Arrange
            IStorage storage = new FileSystemStorage(this._storagePath);

            // Act
            var list = await storage.GetContainersListAsync(null);

            // Assert
            Assert.NotNull(list);
            Assert.True(list.Any(l => string.Equals(FileSystemStorageTests._precreatedContainerName, l)));
        }
        public async Task DesktopStorageGetListOfContainers()
        {
            // Arrange
            IStorage storage = new FileSystemStorage(this._storagePath);

            // Act
            var list = await storage.GetContainersListAsync(null);

            // Assert
            Assert.NotNull(list);
            Assert.True(list.Any(l => string.Equals(FileSystemStorageTests._precreatedContainerName, l)));
        }
예제 #3
0
        public async Task DesktopStorageTryToDeleteContainer()
        {
            // Arrange
            IStorage     storage       = new FileSystemStorage(this._storagePath);
            const string containerName = "DesktopStorageTryToDeleteContainer";

            await storage.CreateOrGetContainerAsync(containerName, ContainerPermission.Public, failIfExists : false);

            var storages1 = await storage.GetContainersListAsync(containerName);

            // Act

            await storage.DeleteContainerAsync(containerName);

            var storages2 = await storage.GetContainersListAsync(containerName);

            // Assert
            Assert.NotNull(storages1);
            Assert.NotNull(storages2);
            Assert.True(storages1.All(c => string.Equals(c, containerName)));
            Assert.False(storages2.Any());
        }
        public async Task DesktopStorageTryToDeleteContainer()
        {
            // Arrange
            IStorage storage = new FileSystemStorage(this._storagePath);
            const string containerName = "DesktopStorageTryToDeleteContainer";

            await storage.CreateOrGetContainerAsync(containerName, ContainerPermission.Public, failIfExists: false);
            var storages1 = await storage.GetContainersListAsync(containerName);

            // Act

            await storage.DeleteContainerAsync(containerName);
            var storages2 = await storage.GetContainersListAsync(containerName);

            // Assert
            Assert.NotNull(storages1);
            Assert.NotNull(storages2);
            Assert.True(storages1.All(c => string.Equals(c, containerName)));
            Assert.False(storages2.Any());
        }