예제 #1
0
        public void ArchiveBuilderTest()
        {
            Cleanup();
            HalvaPackage package = new HalvaPackage(sourceFolder, destinationArchive);

            package.CloseArchive();
            PackageUtilities.ExportFromArchive(destinationArchive, destinationFolder);
            package.Dispose();
        }
예제 #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"));
     }
 }
예제 #3
0
        public void CanArchiveAddEntry()
        {
            HalvaPackage package = new HalvaPackage(PackageUtilities.TempArchive, destinationArchive);

            package.AddFileToList(Path.Combine(sourceFolder, "TestImage.webp"));
            package.CloseArchive();
            if (Directory.Exists(destinationFolder))
            {
                Directory.Delete(destinationFolder, true);
            }
            PackageUtilities.ExportFromArchive(destinationArchive, destinationFolder);
            Assert.Equal(3, Directory.EnumerateFiles(destinationFolder).Count());
            package.Dispose();
        }
예제 #4
0
        public void CanArchiveRemoveEntry()
        {
            HalvaPackage package = new HalvaPackage(PackageUtilities.TempArchive, destinationArchive);

            package.RemoveFileFromList("TestImage.webp");
            package.CloseArchive();
            if (Directory.Exists(destinationFolder))
            {
                Directory.Delete(destinationFolder, true);
            }
            PackageUtilities.ExportFromArchive(destinationArchive, destinationFolder);
            Assert.Equal(2, Directory.EnumerateFiles(destinationFolder).Count());
            package.Dispose();
        }
예제 #5
0
        public void DecompressionCheck()
        {
            bool finished = true;

            if (Directory.Exists("SampleFiles1"))
            {
                Directory.Delete("SampleFiles1", true);
            }
            try
            {
                PackageUtilities.ExportFromArchive("SampleFiles.halva", "SampleFiles1");
            }
            catch (Exception e)
            {
                _testOutputHelper.WriteLine(e.ToString());
                finished = false;
            }
            Assert.True(finished);
        }