mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Correct PremiereDateComparerTests
Correct PremiereDateComparerTests - Adjust expected values, add comments, add extra test
This commit is contained in:
parent
86835dd3c6
commit
8933574ce9
@ -23,22 +23,32 @@ namespace Jellyfin.Server.Implementations.Tests.Sorting
|
|||||||
public PremiereDateTestData()
|
public PremiereDateTestData()
|
||||||
{
|
{
|
||||||
// Both have premier date
|
// Both have premier date
|
||||||
|
// Expected: x listed first
|
||||||
Add(
|
Add(
|
||||||
new Movie { PremiereDate = new DateTime(2021, 1, 1) },
|
new Movie { PremiereDate = new DateTime(2021, 1, 1) },
|
||||||
new Movie { PremiereDate = new DateTime(2021, 1, 3) },
|
new Movie { PremiereDate = new DateTime(2021, 1, 3) },
|
||||||
0);
|
-1);
|
||||||
|
|
||||||
// Only x has premiere date
|
// Only x has premiere date, with earlier year than y
|
||||||
|
// Expected: x listed first
|
||||||
Add(
|
Add(
|
||||||
new Movie { PremiereDate = new DateTime(2021, 1, 1) },
|
new Movie { PremiereDate = new DateTime(2021, 1, 1) },
|
||||||
new Movie { ProductionYear = 2022 },
|
new Movie { ProductionYear = 2022 },
|
||||||
1);
|
-1);
|
||||||
|
|
||||||
// Only x has premiere date, with same year as y
|
// Only x has premiere date, with same year as y
|
||||||
|
// Expected: y listed first
|
||||||
|
Add(
|
||||||
|
new Movie { PremiereDate = new DateTime(2021, 1, 2) },
|
||||||
|
new Movie { ProductionYear = 2021 },
|
||||||
|
1);
|
||||||
|
|
||||||
|
// Only x has a premiere date, with later year than y
|
||||||
|
// Expected: y listed first
|
||||||
Add(
|
Add(
|
||||||
new Movie { PremiereDate = new DateTime(2021, 3, 1) },
|
new Movie { PremiereDate = new DateTime(2021, 3, 1) },
|
||||||
new Movie { ProductionYear = 2021 },
|
new Movie { ProductionYear = 2020 },
|
||||||
2);
|
1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user