Esempio n. 1
0
        public void ArchiveBuilderTest()
        {
            Cleanup();
            EncryptedHalvaPackage package = new EncryptedHalvaPackage(sourceFolder, destinationArchive, testPassword);

            package.CloseArchive();
            EncryptedPackageUtilities.ExportFromArchive(destinationArchive, destinationFolder, testPassword);
        }
 private void ExtractPackage(string PackageName)
 {
     if (PackagePassword != "")
     {
         EncryptedPackageUtilities.ExportFromArchive(Path.Combine(PackageLocation, PackageName), Path.Combine(ExctractLocation, "GameData"), PackagePassword);
     }
     else
     {
         PackageUtilities.ExportFromArchive(Path.Combine(PackageLocation, PackageName), Path.Combine(ExctractLocation, "GameData"));
     }
 }
Esempio n. 3
0
        public void CanArchiveAddEntry()
        {
            EncryptedHalvaPackage package = new EncryptedHalvaPackage(destinationArchive, testPassword);

            package.AddFileToList(Path.Combine(sourceFolder, "TestImage.webp"));
            package.CloseArchive();
            if (Directory.Exists(destinationFolder))
            {
                Directory.Delete(destinationFolder, true);
            }
            EncryptedPackageUtilities.ExportFromArchive(destinationArchive, destinationFolder, testPassword);
            Assert.Equal(3, Directory.EnumerateFiles(destinationFolder).Count());
        }
Esempio n. 4
0
        public void CanArchiveRemoveEntry()
        {
            EncryptedHalvaPackage package = new EncryptedHalvaPackage(destinationArchive, testPassword);

            package.RemoveFileFromList("TestImage.webp");
            package.CloseArchive();
            if (Directory.Exists(destinationFolder))
            {
                Directory.Delete(destinationFolder, true);
            }
            EncryptedPackageUtilities.ExportFromArchive(destinationArchive, destinationFolder, testPassword);
            Assert.Equal(2, Directory.EnumerateFiles(destinationFolder).Count());
        }
Esempio n. 5
0
        public void EncryptedDecompressionCheck()
        {
            bool finished = true;

            if (Directory.Exists("SampleFiles2"))
            {
                Directory.Delete("SampleFiles2", true);
            }
            try
            {
                EncryptedPackageUtilities.ExportFromArchive("EncryptedSampleFiles.halva", "SampleFiles2", "1234567890abcdefghijklm");
            }
            catch (Exception e)
            {
                _testOutputHelper.WriteLine(e.ToString());
                finished = false;
            }
            Assert.True(finished);
        }