Beispiel #1
0
        public void ExtractPasswordProtectedZipFileTest()
        {
            var sevenZipWrapper = new SevenZipSharpWrapper(PasswordProtectedSourceZipfileName, GlobalDefinitions.DefaultInfectedPassword);

            sevenZipWrapper.ExtractArchiveTo(_distinationPath);
            var contents = Directory.GetFiles(_distinationPath);

            Assert.IsTrue(null != contents && contents.Length > 0);
        }
Beispiel #2
0
        public void ExtractPasswordProtectedZipFilePasswordMismatchShouldThrowException()
        {
            var sevenZipWrapper = new SevenZipSharpWrapper(PasswordProtectedSourceZipfileName, @"clean")
            {
                ThrowException = true
            };

            sevenZipWrapper.ExtractArchiveTo(_distinationPath);
        }
Beispiel #3
0
 public void ArchiveFormatTest()
 {
     string []         sourceFiles = { @"D:\Data\MetaDataMerge\MetaDataMerge.zip",
                                       @"D:\Data\MigrationTools-2_2_TO_2_2_5.exe",
                                       @"D:\Download\AnkhSvn-2.1.10129.msi",
                                       @"D:\Download\en_office_communicator_2005.iso",
                                       @"D:\Download\MemProfilerInstaller4_0_119.exe", };
     InArchiveFormat[] ExpectedType = { InArchiveFormat.Zip,
                                        InArchiveFormat.SevenZip,
                                        InArchiveFormat.Cab,
                                        InArchiveFormat.Iso,
                                        InArchiveFormat.PE };
     for (int i = 0; i < sourceFiles.Length; ++i)
     {
         var sevenZipWrapper = new SevenZipSharpWrapper(sourceFiles[i]);
         Assert.AreEqual(sevenZipWrapper.InputArchiveFormat, ExpectedType[i]);
     }
 }