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")); } }
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()); }
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()); }
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); }