mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-31 20:24:27 -04:00
28 lines
675 B
C#
28 lines
675 B
C#
using System;
|
|
using API.Comparators;
|
|
using Xunit;
|
|
|
|
namespace API.Tests.Services
|
|
{
|
|
public class StringLogicalComparerTest
|
|
{
|
|
[Theory]
|
|
[InlineData(
|
|
new[] {"x1.jpg", "x10.jpg", "x3.jpg", "x4.jpg", "x11.jpg"},
|
|
new[] {"x1.jpg", "x3.jpg", "x4.jpg", "x10.jpg", "x11.jpg"}
|
|
)]
|
|
|
|
public void TestLogicalComparer(string[] input, string[] expected)
|
|
{
|
|
NumericComparer nc = new NumericComparer();
|
|
Array.Sort(input, nc);
|
|
|
|
var i = 0;
|
|
foreach (var s in input)
|
|
{
|
|
Assert.Equal(s, expected[i]);
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
} |