Ejemplo n.º 1
0
        public async Task DeleteFolderTest()
        {
            var provider  = new FileSystemProvider(BaseDir);
            var filename1 = "testfolder\\" + Path.GetRandomFileName();
            var filename2 = "testfolder\\" + Path.GetRandomFileName();
            await provider.AddFile(RandomFileGenerator.RandomFileByteArray(1000), filename1);

            await provider.AddFile(RandomFileGenerator.RandomFileByteArray(2000), filename2);

            var result = await provider.DeleteFolder("testfolder");

            Assert.IsTrue(result);
            Assert.IsFalse(await provider.FileExists(filename1));
            Assert.IsFalse(await provider.FileExists(filename2));
        }
Ejemplo n.º 2
0
 public void DeleteDirectory_RightParams_DeleteDirectory()
 {
     Directory.CreateDirectory(@"C:\Home\Temp\xxx");
     fileSystemProvider.DeleteFolder(@"C:\Home\Temp\xxx");
     Assert.IsFalse(Directory.Exists(@"C:\Home\Temp\xxx"));
 }