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

            package.CloseArchive();
            EncryptedPackageUtilities.ExportFromArchive(destinationArchive, destinationFolder, testPassword);
        }
Ejemplo n.º 2
0
 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"));
     }
 }
Ejemplo 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());
        }
Ejemplo 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());
        }
Ejemplo 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);
        }