Lots of work for chapters. This code will be refactored in a chapter rewrite.
This commit is contained in:
parent
f430595d11
commit
a42e54a078
11 changed files with 99 additions and 13 deletions
19
API.Tests/ChapterSortComparerTest.cs
Normal file
19
API.Tests/ChapterSortComparerTest.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue