public void DeleteDirectoryWithNullPath() { // Setup var fileSystem = new PathTree <string>(); // Execute fileSystem.DeleteDirectory(a_path: null); }
public void DeleteDirectoryWithPartialName() { // Setup var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(@"x:\directory\this is a directory"); fileSystem.CreateDirectory(@"x:\directory\this is"); // Execute fileSystem.DeleteDirectory(@"x:\directory\this is"); // Assert Assert.IsTrue(fileSystem.DirectoryExists(@"x:\directory\this is a directory")); }
public void DeleteDirectory() { // Setup var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(@"x:\directory1"); fileSystem.CreateDirectory(@"X:\DIRECTORY2\CHILD"); fileSystem.CreateFile(@"x:\directory2\file.rgb", "Value"); // Execute fileSystem.DeleteDirectory(@"x:\directory2"); // Assert Assert.IsTrue(fileSystem.DirectoryExists(@"x:\directory1")); Assert.IsFalse(fileSystem.DirectoryExists((@"x:\directory2"))); Assert.IsFalse(fileSystem.DirectoryExists(@"x:\directory2\child")); Assert.IsFalse(fileSystem.FileExists(@"x:\directory2\file.rgb")); }
public void DeleteNotExistingDirectory() { // Setup var root = Path.GetPathRoot(Environment.SystemDirectory); var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory($@"{root}directory1"); fileSystem.CreateDirectory($@"{root}directory2\child"); fileSystem.CreateFile($@"{root}directory2\file.rgb", "Value"); // Execute fileSystem.DeleteDirectory(@"\directory3"); // Assert Assert.IsTrue(fileSystem.DirectoryExists($@"{root}directory1")); Assert.IsTrue(fileSystem.DirectoryExists(($@"{root}directory2"))); Assert.IsTrue(fileSystem.DirectoryExists($@"{root}directory2\child")); Assert.IsTrue(fileSystem.FileExists($@"{root}directory2\file.rgb")); }
public void DeleteNotExistingDirectory() { // Setup var root = Path.GetPathRoot(Environment.SystemDirectory); var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory($@"{root}directory1"); fileSystem.CreateDirectory($@"{root}directory2\child"); fileSystem.CreateFile($@"{root}directory2\file.rgb", "Value"); // Execute fileSystem.DeleteDirectory(@"\directory3"); // Assert Assert.IsTrue(fileSystem.DirectoryExists($@"{root}directory1")); Assert.IsTrue(fileSystem.DirectoryExists(($@"{root}directory2"))); Assert.IsTrue(fileSystem.DirectoryExists($@"{root}directory2\child")); Assert.IsTrue(fileSystem.FileExists($@"{root}directory2\file.rgb")); }
public void DeleteDirectoryWithPartialName() { // Setup var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(@"x:\directory\this is a directory"); fileSystem.CreateDirectory(@"x:\directory\this is"); // Execute fileSystem.DeleteDirectory(@"x:\directory\this is"); // Assert Assert.IsTrue(fileSystem.DirectoryExists(@"x:\directory\this is a directory")); }
public void DeleteDirectoryWithNullPath() { // Setup var fileSystem = new PathTree<string>(); // Execute fileSystem.DeleteDirectory(a_path: null); }
public void DeleteDirectory() { // Setup var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(@"x:\directory1"); fileSystem.CreateDirectory(@"X:\DIRECTORY2\CHILD"); fileSystem.CreateFile(@"x:\directory2\file.rgb", "Value"); // Execute fileSystem.DeleteDirectory(@"x:\directory2"); // Assert Assert.IsTrue(fileSystem.DirectoryExists(@"x:\directory1")); Assert.IsFalse(fileSystem.DirectoryExists((@"x:\directory2"))); Assert.IsFalse(fileSystem.DirectoryExists(@"x:\directory2\child")); Assert.IsFalse(fileSystem.FileExists(@"x:\directory2\file.rgb")); }