Fix for some type management problems

This commit is contained in:
Adam Hathcock
2013-12-21 09:34:40 +00:00
parent d46de85ca2
commit be9111630e
2 changed files with 19 additions and 1 deletions

View File

@@ -183,6 +183,24 @@ namespace SharpCompress.Test
Assert.AreEqual(new FileInfo(scratchPath1).Length, new FileInfo(scratchPath2).Length);
}
[TestMethod]
public void Zip_Removal_Poly()
{
ResetScratch();
string scratchPath = Path.Combine(TEST_ARCHIVES_PATH, "Zip.deflate.noEmptyDirs.zip");
using (ZipArchive vfs = (ZipArchive)ArchiveFactory.Open(scratchPath))
{
var e = vfs.Entries.First(v => v.FilePath.EndsWith("jpg"));
vfs.RemoveEntry(e);
Assert.IsNull(vfs.Entries.FirstOrDefault(v => v.FilePath.EndsWith("jpg")));
Assert.IsNull(((IArchive)vfs).Entries.FirstOrDefault(v => v.FilePath.EndsWith("jpg")));
}
}
[TestMethod]
public void Zip_Create_New()
{

View File

@@ -108,7 +108,7 @@ namespace SharpCompress.Archive
IEnumerable<IArchiveEntry> IArchive.Entries
{
get { return lazyEntries.Cast<IArchiveEntry>(); }
get { return Entries.Cast<IArchiveEntry>(); }
}
IEnumerable<IVolume> IArchive.Volumes