mirror of
https://github.com/ppy/osu.git
synced 2026-06-04 12:24:42 +08:00
Attempt to fix tests
This commit is contained in:
@@ -147,10 +147,19 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
AddUntilStep("wait for load", () => Leaderboard!.IsLoaded);
|
||||
|
||||
AddStep("check watch requests were sent", () =>
|
||||
AddUntilStep("check watch requests were sent", () =>
|
||||
{
|
||||
foreach (var user in MultiplayerUsers)
|
||||
spectatorClient.Verify(s => s.WatchUser(user.UserID), Times.Once);
|
||||
try
|
||||
{
|
||||
foreach (var user in MultiplayerUsers)
|
||||
spectatorClient.Verify(s => s.WatchUser(user.UserID), Times.Once);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (MockException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -181,7 +190,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
spectatorClient.Verify(s => s.StopWatchingUser(user.UserID), Times.Once);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
catch (MockException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
private readonly BindableList<IGameplayLeaderboardScore> scores = new BindableList<IGameplayLeaderboardScore>();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(LeaderboardManager leaderboardManager, GameplayState gameplayState)
|
||||
private void load(LeaderboardManager? leaderboardManager, GameplayState? gameplayState)
|
||||
{
|
||||
var globalScores = leaderboardManager.Scores.Value;
|
||||
var globalScores = leaderboardManager?.Scores.Value;
|
||||
|
||||
IsPartial = leaderboardManager.CurrentCriteria?.Scope != BeatmapLeaderboardScope.Local && globalScores?.TopScores.Count >= 50;
|
||||
IsPartial = leaderboardManager?.CurrentCriteria?.Scope != BeatmapLeaderboardScope.Local && globalScores?.TopScores.Count >= 50;
|
||||
|
||||
if (globalScores != null)
|
||||
{
|
||||
@@ -31,11 +31,14 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
scores.Add(new GameplayLeaderboardScore(topScore, false));
|
||||
}
|
||||
|
||||
scores.Add(new GameplayLeaderboardScore(gameplayState.Score.ScoreInfo.User, gameplayState.ScoreProcessor, true)
|
||||
if (gameplayState != null)
|
||||
{
|
||||
// Local score should always show lower than any existing scores in cases of ties.
|
||||
DisplayOrder = { Value = long.MaxValue }
|
||||
});
|
||||
scores.Add(new GameplayLeaderboardScore(gameplayState.Score.ScoreInfo.User, gameplayState.ScoreProcessor, true)
|
||||
{
|
||||
// Local score should always show lower than any existing scores in cases of ties.
|
||||
DisplayOrder = { Value = long.MaxValue }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user