コード例 #1
0
        public void CanLibrarySaveChanges()
        {
            HalvaPackage package = new HalvaPackage(destinationArchive);

            package.RemoveFileFromList("TestImage.webp");
            package.Save();
            package.AddFileToList(Path.Combine(sourceFolder, "TestImage.webp"));
            package.Save();
        }
コード例 #2
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();
        }