ComicVine Finish Line (#2779)
This commit is contained in:
parent
4ccac5f479
commit
353d44a882
57 changed files with 8108 additions and 1116 deletions
|
@ -6,17 +6,17 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.3" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
||||
<PackageReference Include="NSubstitute" Version="5.1.0" />
|
||||
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="20.0.15" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="20.0.15" />
|
||||
<PackageReference Include="xunit" Version="2.6.6" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
|
||||
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="20.0.28" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="20.0.28" />
|
||||
<PackageReference Include="xunit" Version="2.7.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0">
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
|
|
@ -77,6 +77,53 @@ public class SeriesExtensionsTests
|
|||
{
|
||||
var series = new SeriesBuilder("Test 1")
|
||||
.WithFormat(MangaFormat.Archive)
|
||||
.WithVolume(new VolumeBuilder(Parser.LooseLeafVolume)
|
||||
.WithName(Parser.LooseLeafVolume)
|
||||
.WithChapter(new ChapterBuilder("-1")
|
||||
.WithCoverImage("Chapter -1")
|
||||
.Build())
|
||||
.WithChapter(new ChapterBuilder("0.5")
|
||||
.WithCoverImage("Chapter 0.5")
|
||||
.Build())
|
||||
.WithChapter(new ChapterBuilder("2")
|
||||
.WithCoverImage("Chapter 2")
|
||||
.Build())
|
||||
.WithChapter(new ChapterBuilder("1")
|
||||
.WithCoverImage("Chapter 1")
|
||||
.Build())
|
||||
.WithChapter(new ChapterBuilder("3")
|
||||
.WithCoverImage("Chapter 3")
|
||||
.Build())
|
||||
.WithChapter(new ChapterBuilder("4AU")
|
||||
.WithCoverImage("Chapter 4AU")
|
||||
.Build())
|
||||
.Build())
|
||||
|
||||
.Build();
|
||||
|
||||
|
||||
Assert.Equal("Chapter 1", series.GetCoverImage());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks the case where there are specials and loose leafs, loose leaf chapters should be preferred
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetCoverImage_LooseChapters_WithSub1_Chapter_WithSpecials()
|
||||
{
|
||||
var series = new SeriesBuilder("Test 1")
|
||||
.WithFormat(MangaFormat.Archive)
|
||||
|
||||
.WithVolume(new VolumeBuilder(Parser.SpecialVolume)
|
||||
.WithName(Parser.SpecialVolume)
|
||||
.WithChapter(new ChapterBuilder("I am a Special")
|
||||
.WithCoverImage("I am a Special")
|
||||
.Build())
|
||||
.WithChapter(new ChapterBuilder("I am a Special 2")
|
||||
.WithCoverImage("I am a Special 2")
|
||||
.Build())
|
||||
.Build())
|
||||
|
||||
.WithVolume(new VolumeBuilder(Parser.LooseLeafVolume)
|
||||
.WithName(Parser.LooseLeafVolume)
|
||||
.WithChapter(new ChapterBuilder("0.5")
|
||||
|
|
|
@ -208,8 +208,9 @@ public class ComicParsingTests
|
|||
[InlineData("Batman Beyond Omnibus (1999)", true)]
|
||||
[InlineData("Batman Beyond Omnibus", true)]
|
||||
[InlineData("01 Annual Batman Beyond", true)]
|
||||
[InlineData("Blood Syndicate Annual #001", true)]
|
||||
public void IsComicSpecialTest(string input, bool expected)
|
||||
{
|
||||
Assert.Equal(expected, API.Services.Tasks.Scanner.Parser.Parser.IsComicSpecial(input));
|
||||
Assert.Equal(expected, Parser.IsComicSpecial(input));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -721,6 +721,45 @@ public class DirectoryServiceTests
|
|||
|
||||
#endregion
|
||||
|
||||
#region FindLowestDirectoriesFromFiles
|
||||
|
||||
[Theory]
|
||||
[InlineData(new [] {"C:/Manga/"},
|
||||
new [] {"C:/Manga/Love Hina/Vol. 01.cbz"},
|
||||
"C:/Manga/Love Hina")]
|
||||
[InlineData(new [] {"C:/Manga/"},
|
||||
new [] {"C:/Manga/Romance/Love Hina/Vol. 01.cbz"},
|
||||
"C:/Manga/Romance/Love Hina")]
|
||||
[InlineData(new [] {"C:/Manga/Dir 1/", "c://Manga/Dir 2/"},
|
||||
new [] {"C:/Manga/Dir 1/Love Hina/Vol. 01.cbz"},
|
||||
"C:/Manga/Dir 1/Love Hina")]
|
||||
[InlineData(new [] {"C:/Manga/Dir 1/", "c://Manga/"},
|
||||
new [] {"D:/Manga/Love Hina/Vol. 01.cbz", "D:/Manga/Vol. 01.cbz"},
|
||||
null)]
|
||||
[InlineData(new [] {"C:/Manga/"},
|
||||
new [] {"C:/Manga//Love Hina/Vol. 01.cbz"},
|
||||
"C:/Manga/Love Hina")]
|
||||
[InlineData(new [] {@"C:\mount\drive\Library\Test Library\Comics\"},
|
||||
new [] {@"C:\mount\drive\Library\Test Library\Comics\Bruce Lee (1994)\Bruce Lee #001 (1994).cbz"},
|
||||
@"C:/mount/drive/Library/Test Library/Comics/Bruce Lee (1994)")]
|
||||
public void FindLowestDirectoriesFromFilesTest(string[] rootDirectories, string[] files, string expectedDirectory)
|
||||
{
|
||||
var fileSystem = new MockFileSystem();
|
||||
foreach (var directory in rootDirectories)
|
||||
{
|
||||
fileSystem.AddDirectory(directory);
|
||||
}
|
||||
foreach (var f in files)
|
||||
{
|
||||
fileSystem.AddFile(f, new MockFileData(""));
|
||||
}
|
||||
var ds = new DirectoryService(Substitute.For<ILogger<DirectoryService>>(), fileSystem);
|
||||
|
||||
var actual = ds.FindLowestDirectoriesFromFiles(rootDirectories, files);
|
||||
Assert.Equal(expectedDirectory, actual);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region GetFoldersTillRoot
|
||||
|
||||
[Theory]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue