Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for EPUB 2 NCX navigation list parsing #56

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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