Пример #1
0
        public void Test4()
        {
            const string fileName   = "testFile.txt";
            string       targetFile = _TestTempDirectory + "t e s t.rar";
            StreamWriter sw         = new StreamWriter(_TestTempDirectory + fileName, false);

            sw.Write("测试文件,随意删除,不过见到此文件就说明垃圾清理工作没有做好-_-!");
            sw.Close();
            CommandRunner.RarDirectoryToFile(targetFile, _TestTempDirectory);
            Assert.IsTrue(File.Exists(targetFile));

            string tempDir = DiskOperations.CorrectDirectory(_TestTempDirectory) + "T e m p s" + "\\";

            Assert.IsTrue(!File.Exists(tempDir + fileName));
            DiskOperations.CheckAndCreateDirectory(tempDir);
            CommandRunner.UnRarFileToDirectory(targetFile, tempDir, true);
            Assert.IsTrue(File.Exists(tempDir + fileName));

            CommandRunner.CleanUpDirectory(tempDir);
            CommandRunner.CleanUpDirectory(_TestTempDirectory);
        }