Fallback to other locations when ComicInfo.xml not at root of archive (#1551)
* Fallback to other locations when ComicInfo.xml not at root of archive * Better ComicInfo test coverage and benchmarks * Add a rar archive to the ComicInfo test cases
This commit is contained in:
parent
aafbce377b
commit
bc1e314326
8 changed files with 85 additions and 17 deletions
|
@ -256,17 +256,31 @@ public class ArchiveServiceTests
|
|||
Assert.Equal("Junya Inoue", comicInfo.Writer);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ShouldHaveComicInfo_TopLevelFileOnly()
|
||||
[Theory]
|
||||
[InlineData("ComicInfo_duplicateInfos.zip")]
|
||||
[InlineData("ComicInfo_duplicateInfos_reversed.zip")]
|
||||
[InlineData("ComicInfo_duplicateInfos.rar")]
|
||||
public void ShouldHaveComicInfo_TopLevelFileOnly(string filename)
|
||||
{
|
||||
var testDirectory = Path.Join(Directory.GetCurrentDirectory(), "../../../Services/Test Data/ArchiveService/ComicInfos");
|
||||
var archive = Path.Join(testDirectory, "ComicInfo_duplicateInfos.zip");
|
||||
var archive = Path.Join(testDirectory, filename);
|
||||
|
||||
var comicInfo = _archiveService.GetComicInfo(archive);
|
||||
Assert.NotNull(comicInfo);
|
||||
Assert.Equal("BTOOOM!", comicInfo.Series);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ShouldHaveComicInfo_OutsideRoot()
|
||||
{
|
||||
var testDirectory = Path.Join(Directory.GetCurrentDirectory(), "../../../Services/Test Data/ArchiveService/ComicInfos");
|
||||
var archive = Path.Join(testDirectory, "ComicInfo_outside_root.zip");
|
||||
|
||||
var comicInfo = _archiveService.GetComicInfo(archive);
|
||||
Assert.NotNull(comicInfo);
|
||||
Assert.Equal("BTOOOM! - Duplicate", comicInfo.Series);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CanParseComicInfo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue