diff --git a/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsResultsScreen.cs b/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsResultsScreen.cs
index ee9a0e263b..f5fe00458a 100644
--- a/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsResultsScreen.cs
+++ b/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsResultsScreen.cs
@@ -259,7 +259,7 @@ namespace osu.Game.Tests.Visual.Playlists
{
multiplayerUserScore.ScoresAround.Lower.Scores.Add(new MultiplayerScore
{
- ID = --highestScoreId,
+ ID = getNextLowestScoreId(),
Accuracy = userScore.Accuracy,
Passed = true,
Rank = userScore.Rank,
@@ -274,7 +274,7 @@ namespace osu.Game.Tests.Visual.Playlists
multiplayerUserScore.ScoresAround.Higher.Scores.Add(new MultiplayerScore
{
- ID = ++lowestScoreId,
+ ID = getNextHighestScoreId(),
Accuracy = userScore.Accuracy,
Passed = true,
Rank = userScore.Rank,
@@ -306,7 +306,7 @@ namespace osu.Game.Tests.Visual.Playlists
{
result.Scores.Add(new MultiplayerScore
{
- ID = sort == "score_asc" ? --highestScoreId : ++lowestScoreId,
+ ID = sort == "score_asc" ? getNextHighestScoreId() : getNextLowestScoreId(),
Accuracy = 1,
Passed = true,
Rank = ScoreRank.X,
@@ -327,6 +327,17 @@ namespace osu.Game.Tests.Visual.Playlists
return result;
}
+ ///
+ /// The next highest score ID to appear at the left of the list. Monotonically decreasing.
+ ///
+ private int getNextHighestScoreId() => --highestScoreId;
+
+ ///
+ /// The next lowest score ID to appear at the right of the list. Monotonically increasing.
+ ///
+ ///
+ private int getNextLowestScoreId() => ++lowestScoreId;
+
private void addCursor(MultiplayerScores scores)
{
scores.Cursor = new Cursor
@@ -342,7 +353,9 @@ namespace osu.Game.Tests.Visual.Playlists
{
Properties = new Dictionary
{
- { "sort", JToken.FromObject(scores.Scores[^1].ID > scores.Scores[^2].ID ? "score_asc" : "score_desc") }
+ // [ 1, 2, 3, ... ] => score_desc (will be added to the right of the list)
+ // [ 3, 2, 1, ... ] => score_asc (will be added to the left of the list)
+ { "sort", JToken.FromObject(scores.Scores[^1].ID > scores.Scores[^2].ID ? "score_desc" : "score_asc") }
}
};
}