mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
Fix warnings in test projects
This commit is contained in:
@@ -9,22 +9,21 @@ namespace Jellyfin.Server.Implementations.Tests.Sorting
|
||||
{
|
||||
public class AiredEpisodeOrderComparerTests
|
||||
{
|
||||
private readonly AiredEpisodeOrderComparer _cmp = new AiredEpisodeOrderComparer();
|
||||
|
||||
[Theory]
|
||||
[ClassData(typeof(EpisodeBadData))]
|
||||
public void Compare_GivenNull_ThrowsArgumentNullException(BaseItem? x, BaseItem? y)
|
||||
{
|
||||
var cmp = new AiredEpisodeOrderComparer();
|
||||
Assert.Throws<ArgumentNullException>(() => cmp.Compare(x, y));
|
||||
Assert.Throws<ArgumentNullException>(() => _cmp.Compare(x, y));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ClassData(typeof(EpisodeTestData))]
|
||||
public void AiredEpisodeOrderCompareTest(BaseItem x, BaseItem y, int expected)
|
||||
{
|
||||
var cmp = new AiredEpisodeOrderComparer();
|
||||
|
||||
Assert.Equal(expected, cmp.Compare(x, y));
|
||||
Assert.Equal(-expected, cmp.Compare(y, x));
|
||||
Assert.Equal(expected, _cmp.Compare(x, y));
|
||||
Assert.Equal(-expected, _cmp.Compare(y, x));
|
||||
}
|
||||
|
||||
private sealed class EpisodeBadData : TheoryData<BaseItem?, BaseItem?>
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Jellyfin.Server.Implementations.Tests.Sorting;
|
||||
|
||||
public class IndexNumberComparerTests
|
||||
{
|
||||
private readonly IBaseItemComparer _cmp = new IndexNumberComparer();
|
||||
private readonly IndexNumberComparer _cmp = new IndexNumberComparer();
|
||||
|
||||
public static TheoryData<BaseItem?, BaseItem?> Compare_GivenNull_ThrowsArgumentNullException_TestData()
|
||||
=> new()
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Jellyfin.Server.Implementations.Tests.Sorting;
|
||||
|
||||
public class ParentIndexNumberComparerTests
|
||||
{
|
||||
private readonly IBaseItemComparer _cmp = new ParentIndexNumberComparer();
|
||||
private readonly ParentIndexNumberComparer _cmp = new ParentIndexNumberComparer();
|
||||
|
||||
public static TheoryData<BaseItem?, BaseItem?> Compare_GivenNull_ThrowsArgumentNullException_TestData()
|
||||
=> new()
|
||||
|
||||
Reference in New Issue
Block a user