예제 #1
0
 public static async Task ReadStreamOps()
 {
     using (ZipArchive archive = new ZipArchive(await StreamHelpers.CreateTempCopyStream(ZipTest.zfile("normal.zip")), ZipArchiveMode.Read))
     {
         foreach (ZipArchiveEntry e in archive.Entries)
         {
             using (Stream s = e.Open())
             {
                 Assert.True(s.CanRead, "Can read to read archive");
                 Assert.False(s.CanWrite, "Can't write to read archive");
                 Assert.False(s.CanSeek, "Can't seek on archive");
                 Assert.Equal(ZipTest.LengthOfUnseekableStream(s), e.Length); //"Length is not correct on unseekable stream"
             }
         }
     }
 }