Skip to content

Commit

Permalink
Fix for EPUB 2 NCX navigation list parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
vers-one committed Sep 5, 2022
1 parent 9c4a8d5 commit aab03db
Show file tree
Hide file tree
Showing 7 changed files with 1,064 additions and 73 deletions.
14 changes: 14 additions & 0 deletions Source/VersOne.Epub.Test/Unit/Mocks/Test4GbZipFileEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using VersOne.Epub.Environment;

namespace VersOne.Epub.Test.Unit.Mocks
{
internal class Test4GbZipFileEntry : IZipFileEntry
{
public long Length => (long)4 * 1024 * 1024 * 1024;

public Stream Open()
{
return new MemoryStream();
}
}
}
11 changes: 8 additions & 3 deletions Source/VersOne.Epub.Test/Unit/Mocks/TestZipFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ namespace VersOne.Epub.Test.Unit.Mocks
{
internal class TestZipFile : IZipFile
{
readonly Dictionary<string, TestZipFileEntry> entries;
readonly Dictionary<string, IZipFileEntry> entries;

public TestZipFile()
{
entries = new Dictionary<string, TestZipFileEntry>();
entries = new Dictionary<string, IZipFileEntry>();
}

public void AddEntry(string entryName, IZipFileEntry entry)
{
entries.Add(entryName, entry);
}

public void AddEntry(string entryName, string entryContent)
Expand All @@ -18,7 +23,7 @@ public void AddEntry(string entryName, string entryContent)

public IZipFileEntry GetEntry(string entryName)
{
return entries.TryGetValue(entryName, out TestZipFileEntry value) ? value : null;
return entries.TryGetValue(entryName, out IZipFileEntry value) ? value : null;
}

public void Dispose()
Expand Down
Loading

0 comments on commit aab03db

Please sign in to comment.