示例#1
0
        public void Test_rdRecursive()
        {
            Environment.CurrentDirectory = testFolder;
            var    shell = new CShell();
            string xyz   = Path.Combine(testFolder, "xyz");

            if (Directory.Exists(xyz))
            {
                Directory.Delete(xyz, true);
            }

            shell.md("xyz");
            Assert.IsTrue(Directory.EnumerateDirectories(testFolder).Where(path => Path.GetFileName(path) == "xyz").Any(), "xyz not created");

            shell.cd("xyz");
            shell.md("xyz");
            Assert.IsTrue(Directory.EnumerateDirectories(testFolder).Where(path => Path.GetFileName(path) == "xyz").Any(), "xyz not created");

            shell.cd(testFolder);
            shell.rd("xyz", true);
            Assert.IsFalse(Directory.EnumerateDirectories(testFolder).Where(path => Path.GetFileName(path) == "xyz").Any(), "xyz not created");
        }