public void CanEmptyADirectory() { TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create(); string fileName = directory.GetPath("test.txt"); File.WriteAllText(fileName, String.Empty); directory.Empty(); string[] fileEntries = Directory.GetFiles(directory.GetPath()); Console.WriteLine(fileEntries); Assert.True(fileEntries.Length == 0); }
public void CanForceCreateTemporaryDirectoryWithName() { TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().SetName("testing_folder_1").Create(); directory = new TemporaryDirectoryHandler().SetForce(true).SetName("testing_folder_1").Create(); Assert.True(Directory.Exists(directory.GetPath())); }
public void CanDeleteDirectoryWithContent() { TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create(); string fileName = directory.GetPath("test.txt"); File.WriteAllText(fileName, String.Empty); Assert.True(directory.Delete()); }
public void CanCreateTemporaryDirectoryInLocation() { TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler(Directory.GetCurrentDirectory() + "/temp_folder").Create(); Assert.True(Directory.Exists(directory.GetPath())); }
public void CanCreateTemporaryDirectory() { TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create(); Assert.True(Directory.Exists(directory.GetPath())); }