public void EmptyDirectory() { // Setup var fileSystem = new PathTree <string>(); var directory = fileSystem.CreateDirectory(@"\directory"); fileSystem.CreateDirectory(@"\directory\child1"); fileSystem.CreateDirectory(@"\directory\child2"); fileSystem.CreateDirectory(@"\directory\child3"); fileSystem.CreateFile(@"\directory\file1.dat", "Value1"); fileSystem.CreateFile(@"\directory\file2.dat", "Value2"); fileSystem.CreateFile(@"\directory\file3.dat", "Value3"); fileSystem.CreateFile(@"\directory\child2\fileA.dat", "ValueA"); fileSystem.CreateFile(@"\directory\child2\fileB.dat", "ValueB"); fileSystem.CreateFile(@"\directory\child2\fileC.dat", "ValueC"); // Execute directory.Empty(); // Assert Assert.IsTrue(fileSystem.DirectoryExists(@"\directory")); Assert.IsFalse(fileSystem.DirectoryExists(@"\directory\child1")); Assert.IsFalse(fileSystem.DirectoryExists(@"\directory\child2")); Assert.IsFalse(fileSystem.DirectoryExists(@"\directory\child3")); Assert.IsFalse(fileSystem.FileExists(@"\directory\file1.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\file2.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\file3.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\child2\fileA.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\child2\fileB.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\child2\fileC.dat")); }
public void CreateDirectoryMoreThanOnce() { // Setup var fileSystem = new PathTree <string>(); var path = @"X:\This is bad a directory path"; // Execute fileSystem.CreateDirectory(path); fileSystem.CreateDirectory(path); }
public void CreateDirectoryMoreThanOnce() { // Setup var fileSystem = new PathTree<string>(); var path = @"X:\This is bad a directory path"; // Execute fileSystem.CreateDirectory(path); fileSystem.CreateDirectory(path); }
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 GetDirectoriesWithSearchPattern() { // Setup var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(@"x:\mydirectory\directory1"); fileSystem.CreateDirectory(@"x:\mydirectory\directory2\child"); fileSystem.CreateFile(@"x:\mydirectory\directory3\file.rgb", "Value"); // Execute var directoryPaths = fileSystem.GetDirectories(@"X:\MYDIRECTORY", "*1"); // Assert Assert.AreEqual(1, directoryPaths.Length); }
public void GetDirectoryInRoot() { // Setup var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(@"x:\directory1"); fileSystem.CreateDirectory(@"x:\directory2\child"); fileSystem.CreateFile(@"x:\directory3\file.rgb", "Value"); // Execute var directoryPaths = fileSystem.GetDirectories(@"X:\"); // Assert Assert.AreEqual(3, directoryPaths.Length); }
public void GetChildDirectories() { // Setup var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(@"x:\mydirectory\directory1"); fileSystem.CreateDirectory(@"x:\mydirectory\directory2\child"); fileSystem.CreateFile(@"x:\mydirectory\directory3\file.rgb", "Value"); var directory = new PathDirectory <string>(fileSystem, @"x:\mydirectory"); // Execute var result = directory.Directories(); // Assert Assert.AreEqual(3, result.Count()); }
public void GetNotExistingChildDirectoryByName() { // Setup var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(@"x:\mydirectory\directory1"); fileSystem.CreateDirectory(@"x:\mydirectory\directory2\child"); fileSystem.CreateFile(@"x:\mydirectory\directory3\file.rgb", "Value"); var directory = new PathDirectory <string>(fileSystem, @"x:\mydirectory"); // Execute var result = directory.Directory("Directory4"); // Assert Assert.AreEqual("Directory4", result.Name); Assert.IsFalse(result.Exists); }
public void CreateDirectoryWithNull() { // Setup var fileSystem = new PathTree <string>(); // Execute fileSystem.CreateDirectory(a_path: null); }
public void CreateDirectoryWithNull() { // Setup var fileSystem = new PathTree<string>(); // Execute fileSystem.CreateDirectory(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")); }
public void CustomTest_I() { var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(@"\Root\Directory"); fileSystem.CreateDirectory(@"\Root\Directory\Sub1"); fileSystem.CreateDirectory(@"\Root\Directory\Sub2"); fileSystem.CreateDirectory(@"\Root\Directory\Sub3"); fileSystem.CreateFile(@"\Root\Directory\File1.hsf", "Value"); fileSystem.CreateFile(@"\Root\Directory\File2.hsf", "Value"); fileSystem.CreateFile(@"\Root\Directory\File3.hsf", "Value"); var directory = new PathDirectory <string>(fileSystem, @"\"); var result = directory.Directory(@"Root\Directory\Sub1").Exists; Assert.IsTrue(result); }
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 CopyInWithNotExistingDirectory() { // Setup var fileSystem = new PathTree <string>(); var directory = fileSystem.CreateDirectory(@"\directory"); var file = new PathFile <string>(fileSystem, @"\noexisty\file1.dat"); // Execute directory.CopyIn(file); }
public void CopyInWithNullFile() { // Setup var fileSystem = new PathTree <string>(); var directory = fileSystem.CreateDirectory(@"\directory"); fileSystem.CreateFile(@"\file1.dat", "Value"); // Execute directory.CopyIn(a_file: null); }
public void CreateDirectory() { // Setup var fileSystem = new PathTree<string>(); var path = @"X:\This is a directory path\"; // Execute fileSystem.CreateDirectory(path); // Assert Assert.IsTrue(fileSystem.DirectoryExists(path)); }
public void CopyFromWithNotExistingSource() { // Setup var pathTree = new PathTree <string>(); pathTree.CreateDirectory(@"x:\directory"); var source = new PathFile <string>(pathTree, @"x:\directory\File.bmp"); var file = new PathFile <string>(pathTree, @"x:\directory\file2.bmp"); // Execute file.CopyFrom(source); }
public void CreateDirectory() { // Setup var fileSystem = new PathTree <string>(); var path = @"X:\This is a directory path\"; // Execute fileSystem.CreateDirectory(path); // Assert Assert.IsTrue(fileSystem.DirectoryExists(path)); }
public void GetIsEmptyOnNonemptyDirectory() { // Setup var fileSystem = new PathTree <string>(); var directory = fileSystem.CreateDirectory("\\directory\\does\\not\\exist"); // Execute var result = directory.Parent.IsEmpty; // Assert Assert.IsFalse(result); }
public void DirectoryExistsOnChildDirectory() { // Setup var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(@"X:\Parent\Child"); // Execute var results = fileSystem.DirectoryExists(@"X:\Parent"); // Assert Assert.IsTrue(results); }
//[TestMethod] public void Temp() { var fileSystem = new TestFileSystem(); var pathTree = new PathTree <IFile>(); pathTree.CreateDirectory(@"urban stuff"); pathTree.CreateFile(@"urban stuff\urban1.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban1.hsf")); pathTree.CreateFile(@"urban stuff\urban1.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban1.jpg")); pathTree.CreateFile(@"urban stuff\urban2.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban2.hsf")); pathTree.CreateFile(@"urban stuff\urban2.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban2.jpg")); pathTree.CreateFile(@"urban stuff\urban3.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban3.hsf")); pathTree.CreateFile(@"urban stuff\urban3.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban3.jpg")); pathTree.CreateDirectory(@"curved case stuff"); pathTree.CreateFile(@"curved case stuff\curved1.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved1.hsf")); pathTree.CreateFile(@"curved case stuff\curved1.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved1.jpg")); pathTree.CreateFile(@"curved case stuff\curved2.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved2.hsf")); pathTree.CreateFile(@"curved case stuff\curved2.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved2.jpg")); pathTree.CreateFile(@"curved case stuff\curved3.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved3.hsf")); pathTree.CreateFile(@"curved case stuff\curved3.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved3.jpg")); IFile file = new PathFile <IFile>(pathTree, @"urban stuff\urban1.hsf"); IFile destination = new PathFile <IFile>(pathTree, @"curved case stuff\carved urban1.esa"); if (file.Exists) { file.CopyTo(destination); } file = file.ChangeExtension(".jpg"); destination = destination.ChangeExtension(".jpg"); if (file.Exists) { file.CopyTo(destination); } Assert.IsFalse(pathTree.FileExists(@"urban stuff\urban1.hsf")); Assert.IsTrue(pathTree.FileExists(@"curved case stuff\carved urban1.esa")); }
public void DirectoryExistsWithMissingEndSlash() { // Setup var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(@"X:\This is a directory path\"); // Execute var results = fileSystem.DirectoryExists(@"X:\This is a directory path"); // Assert Assert.IsTrue(results); }
public void DeleteNotExistingFile() { // Setup var pathTree = new PathTree <string>(); pathTree.CreateDirectory("\\this\\is\\a"); var file = new PathFile <string>(pathTree, "\\this\\is\\a\\file.txt"); // Execute file.Delete(); // Assert Assert.IsFalse(file.Exists); }
public void GetExistsOnExistingFile() { // Setup var path = "\\directory\\does\\exist"; var fileSystem = new PathTree <string>(); fileSystem.CreateDirectory(path); var directory = new PathDirectory <string>(fileSystem, path); // Execute var result = directory.Exists; // Assert Assert.IsTrue(result); }
public void DirectoryExists() { // Setup var fileSystem = new PathTree <string>(); var path = @"X:\This is a directory path\"; fileSystem.CreateDirectory(path); // Execute path = path.ToLower(); // Ignores case. var results = fileSystem.DirectoryExists(path.ToLower()); // Assert Assert.IsTrue(results); }
public void CopyIn() { // Setup var fileSystem = new PathTree<string>(); var directory = fileSystem.CreateDirectory(@"\directory"); var file = fileSystem.CreateFile(@"\file1.dat", "Value"); // Execute var result = directory.CopyIn(file); // Assert Assert.IsNotNull(result); Assert.IsTrue(result.Exists); Assert.AreEqual(@"\directory\file1.dat", result.Path); Assert.IsTrue(fileSystem.FileExists(@"\directory\file1.dat")); Assert.IsInstanceOfType(result, typeof (PathFile<string>)); Assert.AreSame(fileSystem, (result as PathFile<string>)?.FileSystem); }
public void CopyIn() { // Setup var fileSystem = new PathTree <string>(); var directory = fileSystem.CreateDirectory(@"\directory"); var file = fileSystem.CreateFile(@"\file1.dat", "Value"); // Execute var result = directory.CopyIn(file); // Assert Assert.IsNotNull(result); Assert.IsTrue(result.Exists); Assert.AreEqual(@"\directory\file1.dat", result.Path); Assert.IsTrue(fileSystem.FileExists(@"\directory\file1.dat")); Assert.IsInstanceOfType(result, typeof(PathFile <string>)); Assert.AreSame(fileSystem, (result as PathFile <string>)?.FileSystem); }
public void GetDirectoryInRoot() { // Setup var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(@"x:\directory1"); fileSystem.CreateDirectory(@"x:\directory2\child"); fileSystem.CreateFile(@"x:\directory3\file.rgb", "Value"); // Execute var directoryPaths = fileSystem.GetDirectories(@"X:\"); // Assert Assert.AreEqual(3, directoryPaths.Length); }
public void CopyToWithNotExistingSource() { // Setup var pathTree = new PathTree<string>(); pathTree.CreateDirectory(@"x:\directory"); var file = new PathFile<string>(pathTree, @"x:\directory\File.bmp"); var dest = new PathFile<string>(pathTree, @"x:\directory\file2.bmp"); // Execute file.CopyTo(dest); }
public void CopyInWithNotExistingDirectory() { // Setup var fileSystem = new PathTree<string>(); var directory = fileSystem.CreateDirectory(@"\directory"); var file = new PathFile<string>(fileSystem, @"\noexisty\file1.dat"); // Execute directory.CopyIn(file); }
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 EmptyDirectory() { // Setup var fileSystem = new PathTree<string>(); var directory = fileSystem.CreateDirectory(@"\directory"); fileSystem.CreateDirectory(@"\directory\child1"); fileSystem.CreateDirectory(@"\directory\child2"); fileSystem.CreateDirectory(@"\directory\child3"); fileSystem.CreateFile(@"\directory\file1.dat", "Value1"); fileSystem.CreateFile(@"\directory\file2.dat", "Value2"); fileSystem.CreateFile(@"\directory\file3.dat", "Value3"); fileSystem.CreateFile(@"\directory\child2\fileA.dat", "ValueA"); fileSystem.CreateFile(@"\directory\child2\fileB.dat", "ValueB"); fileSystem.CreateFile(@"\directory\child2\fileC.dat", "ValueC"); // Execute directory.Empty(); // Assert Assert.IsTrue(fileSystem.DirectoryExists(@"\directory")); Assert.IsFalse(fileSystem.DirectoryExists(@"\directory\child1")); Assert.IsFalse(fileSystem.DirectoryExists(@"\directory\child2")); Assert.IsFalse(fileSystem.DirectoryExists(@"\directory\child3")); Assert.IsFalse(fileSystem.FileExists(@"\directory\file1.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\file2.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\file3.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\child2\fileA.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\child2\fileB.dat")); Assert.IsFalse(fileSystem.FileExists(@"\directory\child2\fileC.dat")); }
public void GetChildDirectories() { // Setup var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(@"x:\mydirectory\directory1"); fileSystem.CreateDirectory(@"x:\mydirectory\directory2\child"); fileSystem.CreateFile(@"x:\mydirectory\directory3\file.rgb", "Value"); var directory = new PathDirectory<string>(fileSystem, @"x:\mydirectory"); // Execute var result = directory.Directories(); // Assert Assert.AreEqual(3, result.Count()); }
public void GetExistsOnExistingFile() { // Setup var path = "\\directory\\does\\exist"; var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(path); var directory = new PathDirectory<string>(fileSystem, path); // Execute var result = directory.Exists; // Assert Assert.IsTrue(result); }
public void GetIsEmptyOnNonemptyDirectory() { // Setup var fileSystem = new PathTree<string>(); var directory = fileSystem.CreateDirectory("\\directory\\does\\not\\exist"); // Execute var result = directory.Parent.IsEmpty; // Assert Assert.IsFalse(result); }
public void GetNotExistingChildDirectoryByName() { // Setup var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(@"x:\mydirectory\directory1"); fileSystem.CreateDirectory(@"x:\mydirectory\directory2\child"); fileSystem.CreateFile(@"x:\mydirectory\directory3\file.rgb", "Value"); var directory = new PathDirectory<string>(fileSystem, @"x:\mydirectory"); // Execute var result = directory.Directory("Directory4"); // Assert Assert.AreEqual("Directory4", result.Name); Assert.IsFalse(result.Exists); }
public void GetDirectoriesWithSearchPattern() { // Setup var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(@"x:\mydirectory\directory1"); fileSystem.CreateDirectory(@"x:\mydirectory\directory2\child"); fileSystem.CreateFile(@"x:\mydirectory\directory3\file.rgb", "Value"); // Execute var directoryPaths = fileSystem.GetDirectories(@"X:\MYDIRECTORY", "*1"); // Assert Assert.AreEqual(1, directoryPaths.Length); }
public void CustomTest_I() { var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(@"\Root\Directory"); fileSystem.CreateDirectory(@"\Root\Directory\Sub1"); fileSystem.CreateDirectory(@"\Root\Directory\Sub2"); fileSystem.CreateDirectory(@"\Root\Directory\Sub3"); fileSystem.CreateFile(@"\Root\Directory\File1.hsf", "Value"); fileSystem.CreateFile(@"\Root\Directory\File2.hsf", "Value"); fileSystem.CreateFile(@"\Root\Directory\File3.hsf", "Value"); var directory = new PathDirectory<string>(fileSystem, @"\"); var result = directory.Directory(@"Root\Directory\Sub1").Exists; Assert.IsTrue(result); }
public void DirectoryExistsWithMissingEndSlash() { // Setup var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(@"X:\This is a directory path\"); // Execute var results = fileSystem.DirectoryExists(@"X:\This is a directory path"); // Assert Assert.IsTrue(results); }
public void CopyInWithNullFile() { // Setup var fileSystem = new PathTree<string>(); var directory = fileSystem.CreateDirectory(@"\directory"); fileSystem.CreateFile(@"\file1.dat", "Value"); // Execute directory.CopyIn(a_file: null); }
public void DirectoryExistsOnChildDirectory() { // Setup var fileSystem = new PathTree<string>(); fileSystem.CreateDirectory(@"X:\Parent\Child"); // Execute var results = fileSystem.DirectoryExists(@"X:\Parent"); // Assert Assert.IsTrue(results); }
//[TestMethod] public void Temp() { var fileSystem = new TestFileSystem(); var pathTree = new PathTree<IFile>(); pathTree.CreateDirectory(@"urban stuff"); pathTree.CreateFile(@"urban stuff\urban1.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban1.hsf")); pathTree.CreateFile(@"urban stuff\urban1.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban1.jpg")); pathTree.CreateFile(@"urban stuff\urban2.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban2.hsf")); pathTree.CreateFile(@"urban stuff\urban2.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban2.jpg")); pathTree.CreateFile(@"urban stuff\urban3.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban3.hsf")); pathTree.CreateFile(@"urban stuff\urban3.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban3.jpg")); pathTree.CreateDirectory(@"curved case stuff"); pathTree.CreateFile(@"curved case stuff\curved1.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved1.hsf")); pathTree.CreateFile(@"curved case stuff\curved1.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved1.jpg")); pathTree.CreateFile(@"curved case stuff\curved2.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved2.hsf")); pathTree.CreateFile(@"curved case stuff\curved2.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved2.jpg")); pathTree.CreateFile(@"curved case stuff\curved3.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved3.hsf")); pathTree.CreateFile(@"curved case stuff\curved3.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved3.jpg")); IFile file = new PathFile<IFile>(pathTree, @"urban stuff\urban1.hsf"); IFile destination = new PathFile<IFile>(pathTree, @"curved case stuff\carved urban1.esa"); if (file.Exists) file.CopyTo(destination); file = file.ChangeExtension(".jpg"); destination = destination.ChangeExtension(".jpg"); if (file.Exists) file.CopyTo(destination); Assert.IsFalse(pathTree.FileExists(@"urban stuff\urban1.hsf")); Assert.IsTrue(pathTree.FileExists(@"curved case stuff\carved urban1.esa")); }
public void DirectoryExists() { // Setup var fileSystem = new PathTree<string>(); var path = @"X:\This is a directory path\"; fileSystem.CreateDirectory(path); // Execute path = path.ToLower(); // Ignores case. var results = fileSystem.DirectoryExists(path.ToLower()); // Assert Assert.IsTrue(results); }
public void DeleteNotExistingFile() { // Setup var pathTree = new PathTree<string>(); pathTree.CreateDirectory("\\this\\is\\a"); var file = new PathFile<string>(pathTree, "\\this\\is\\a\\file.txt"); // Execute file.Delete(); // Assert Assert.IsFalse(file.Exists); }
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 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")); }