示例#1
0
文件: Zip.cs 项目: FherStk/AutoCheck
        public void Extract_Local_Recursive_DoesNotThrow(string file, int expectedFolders, int expectedFiles)
        {
            var local = new AutoCheck.Core.Connectors.Zip(GetSampleFile(file));

            Assert.IsFalse(Directory.Exists(TempScriptFolder));

            Directory.CreateDirectory(TempScriptFolder);
            local.Extract(true, TempScriptFolder);

            Assert.AreEqual(expectedFolders, Directory.GetDirectories(TempScriptFolder, "*", SearchOption.AllDirectories).Length);
            Assert.AreEqual(expectedFiles, Directory.GetFiles(TempScriptFolder, "*", SearchOption.AllDirectories).Length);
        }
示例#2
0
文件: Zip.cs 项目: FherStk/AutoCheck
        public void Extract_Local_NoRecursive_DoesNotThrow(string file, string password, string expectedFile, string expectedContent)
        {
            var local = new AutoCheck.Core.Connectors.Zip(GetSampleFile(file));

            Assert.IsFalse(Directory.Exists(TempScriptFolder));

            Directory.CreateDirectory(TempScriptFolder);
            local.Extract(TempScriptFolder, password);

            Assert.IsTrue(File.Exists(Path.Combine(TempScriptFolder, expectedFile)));
            Assert.AreEqual(expectedContent, File.ReadAllText(Path.Combine(TempScriptFolder, expectedFile)));
        }