Ejemplo n.º 1
0
        public void DeleteDirectoryWithNullPath()
        {
            // Setup
            var fileSystem = new PathTree <string>();

            // Execute
            fileSystem.DeleteDirectory(a_path: null);
        }
Ejemplo n.º 2
0
        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"));
        }
Ejemplo n.º 3
0
        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"));
        }
Ejemplo n.º 4
0
        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"));
        }
Ejemplo n.º 5
0
        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"));
        }
Ejemplo n.º 6
0
        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"));
        }
Ejemplo n.º 7
0
        public void DeleteDirectoryWithNullPath()
        {
            // Setup
            var fileSystem = new PathTree<string>();

            // Execute
            fileSystem.DeleteDirectory(a_path: null);
        }
Ejemplo n.º 8
0
        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"));
        }