mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-03-11 12:35:48 -04:00
Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com> Co-authored-by: Joe Milazzo <josephmajora@gmail.com>
19 lines
762 B
C#
19 lines
762 B
C#
using Kavita.Services.Comparators;
|
|
using Kavita.Services.Scanner;
|
|
|
|
namespace Kavita.Services.Tests.Comparers;
|
|
|
|
public class ChapterSortComparerDefaultLastTest
|
|
{
|
|
[Theory]
|
|
[InlineData(new[] {1, 2, Parser.DefaultChapterNumber}, new[] {1, 2, Parser.DefaultChapterNumber})]
|
|
[InlineData(new[] {3, 1, 2}, new[] {1, 2, 3})]
|
|
[InlineData(new[] {1, Parser.DefaultChapterNumber, Parser.DefaultChapterNumber}, new[] {1, Parser.DefaultChapterNumber, Parser.DefaultChapterNumber})]
|
|
[InlineData(new[] {Parser.DefaultChapterNumber, 1}, new[] {1, Parser.DefaultChapterNumber})]
|
|
public void ChapterSortTest(int[] input, int[] expected)
|
|
{
|
|
Assert.Equal(expected, input.OrderBy(f => f, new ChapterSortComparerDefaultLast()).ToArray());
|
|
}
|
|
|
|
}
|