Hotfix Prep (#2484)
This commit is contained in:
parent
8c16b87ff0
commit
bd4cbeb393
22 changed files with 114 additions and 87 deletions
|
|
@ -44,6 +44,17 @@ public class SmartFilterHelperTests
|
|||
AssertStatementSame(list[0], FilterField.Genres, FilterComparison.Equal, "95");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test_Decode2()
|
||||
{
|
||||
const string encoded = """
|
||||
name=Test%202&stmts=comparison%253D10%25C2%25A6field%253D1%25C2%25A6value%253DA%EF%BF%BDcomparison%253D0%25C2%25A6field%253D19%25C2%25A6value%253D11&sortOptions=sortField%3D1%C2%A6isAscending%3DTrue&limitTo=0&combination=1
|
||||
""";
|
||||
|
||||
var filter = SmartFilterHelper.Decode(encoded);
|
||||
Assert.True(filter.SortOptions.IsAscending);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test_EncodeDecode()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ public class MangaParserTests
|
|||
[InlineData("시즌34삽화2", "34")]
|
||||
[InlineData("Accel World Chapter 001 Volume 002", "2")]
|
||||
[InlineData("Accel World Volume 2", "2")]
|
||||
[InlineData("Nagasarete Airantou - Vol. 30 Ch. 187.5 - Vol.31 Omake", "30")]
|
||||
public void ParseVolumeTest(string filename, string expected)
|
||||
{
|
||||
Assert.Equal(expected, API.Services.Tasks.Scanner.Parser.Parser.ParseVolume(filename));
|
||||
|
|
@ -204,6 +205,7 @@ public class MangaParserTests
|
|||
[InlineData("죠시라쿠! 2년 후 1권", "죠시라쿠! 2년 후")]
|
||||
[InlineData("test 2 years 1권", "test 2 years")]
|
||||
[InlineData("test 2 years 1화", "test 2 years")]
|
||||
[InlineData("Nagasarete Airantou - Vol. 30 Ch. 187.5 - Vol.30 Omake", "Nagasarete Airantou")]
|
||||
public void ParseSeriesTest(string filename, string expected)
|
||||
{
|
||||
Assert.Equal(expected, API.Services.Tasks.Scanner.Parser.Parser.ParseSeries(filename));
|
||||
|
|
|
|||
|
|
@ -2,13 +2,23 @@
|
|||
using Xunit;
|
||||
|
||||
namespace API.Tests.Services;
|
||||
#nullable enable
|
||||
|
||||
public class ScrobblingServiceTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("https://anilist.co/manga/35851/Byeontaega-Doeja/", 35851)]
|
||||
public void CanParseWeblink(string link, long expectedId)
|
||||
[InlineData("https://anilist.co/manga/30105", 30105)]
|
||||
[InlineData("https://anilist.co/manga/30105/Kekkaishi/", 30105)]
|
||||
public void CanParseWeblink_AniList(string link, int? expectedId)
|
||||
{
|
||||
Assert.Equal(ScrobblingService.ExtractId<long>(link, ScrobblingService.AniListWeblinkWebsite), expectedId);
|
||||
Assert.Equal(ScrobblingService.ExtractId<int?>(link, ScrobblingService.AniListWeblinkWebsite), expectedId);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("https://mangadex.org/title/316d3d09-bb83-49da-9d90-11dc7ce40967/honzuki-no-gekokujou-shisho-ni-naru-tame-ni-wa-shudan-wo-erandeiraremasen-dai-3-bu-ryouchi-ni-hon-o", "316d3d09-bb83-49da-9d90-11dc7ce40967")]
|
||||
public void CanParseWeblink_MangaDex(string link, string expectedId)
|
||||
{
|
||||
Assert.Equal(ScrobblingService.ExtractId<string?>(link, ScrobblingService.MangaDexWeblinkWebsite), expectedId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue