Correct PremiereDateComparerTests

Correct PremiereDateComparerTests - Adjust expected values, add comments, add extra test
pull/12251/head
Adam 8 months ago
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( Add(
new Movie { PremiereDate = new DateTime(2021, 3, 1) }, new Movie { PremiereDate = new DateTime(2021, 1, 2) },
new Movie { ProductionYear = 2021 }, new Movie { ProductionYear = 2021 },
2); 1);
// Only x has a premiere date, with later year than y
// Expected: y listed first
Add(
new Movie { PremiereDate = new DateTime(2021, 3, 1) },
new Movie { ProductionYear = 2020 },
1);
} }
} }
} }

Loading…
Cancel
Save