mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-04 06:04:37 -04:00
19 lines
507 B
C#
19 lines
507 B
C#
using System.Linq;
|
|
using API.Comparators;
|
|
using Xunit;
|
|
|
|
namespace API.Tests
|
|
{
|
|
public class ChapterSortComparerTest
|
|
{
|
|
[Theory]
|
|
[InlineData(new[] {1, 2, 0}, new[] {1, 2, 0})]
|
|
[InlineData(new[] {3, 1, 2}, new[] {1, 2, 3})]
|
|
[InlineData(new[] {1, 0, 0}, new[] {1, 0, 0})]
|
|
public void ChapterSortTest(int[] input, int[] expected)
|
|
{
|
|
Assert.Equal(expected, input.OrderBy(f => f, new ChapterSortComparer()).ToArray());
|
|
}
|
|
|
|
}
|
|
} |