public void ArchiveBuilderTest() { Cleanup(); HalvaPackage package = new HalvaPackage(sourceFolder, destinationArchive); package.CloseArchive(); PackageUtilities.ExportFromArchive(destinationArchive, destinationFolder); package.Dispose(); }
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")); } }
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(); }
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(); }
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); }