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); }
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))); }