using Unity.SharpZipLib.Zip; using System.IO; namespace Unity.SharpZipLib.Tests.TestSupport { /// /// Provides support for testing in memory zip archives. /// internal static class ZipTesting { /// /// Tests the archive. /// /// The data. /// public static bool TestArchive(byte[] data) { return TestArchive(data, null); } /// /// Tests the archive. /// /// The data. /// The password. /// true if archive tests ok; false otherwise. public static bool TestArchive(byte[] data, string password) { using (MemoryStream ms = new MemoryStream(data)) using (ZipFile zipFile = new ZipFile(ms)) { zipFile.Password = password; return zipFile.TestArchive(true); } } } }