Adds support for multiple chapters. The previous version ignored any leading chapter numbers in the uri of {chapterId}/images/{image}. It now accounts for that and is working in a locally run user interface for an epub that was broken. I didn't check in the unit test over the GetBookPage method since it requires a specific file. I'll provide that in the PR description, though.
This commit is contained in:
parent
8ed2fa3829
commit
4ca4723ae9
4 changed files with 134 additions and 13 deletions
|
|
@ -16,5 +16,23 @@ public class PathExtensionsTests
|
|||
Assert.Equal(Path.GetFullPath(expected), input.GetFullPathWithoutExtension());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("1/cover.jpeg", "1")]
|
||||
[InlineData("01/cover.jpeg", "01")]
|
||||
[InlineData("01/images/cover.jpeg", "01")]
|
||||
public void GetFirstSegmentSpanTests(string input, string expected)
|
||||
{
|
||||
Assert.Equal(expected, input.GetFirstSegmentSpan().ToString());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("1/cover.jpeg")]
|
||||
[InlineData("01/cover.jpeg")]
|
||||
[InlineData("01/images/cover.jpeg")]
|
||||
public void GetLastSegmentSpanTests(string input)
|
||||
{
|
||||
Assert.Equal("cover.jpeg", input.GetLastSegmentSpan().ToString());
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue