mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 22:13:20 +08:00
Add test covering a more consistent spread of player scores
This commit is contained in:
parent
91fbdc3aed
commit
ceb2e4762d
@ -6,6 +6,7 @@ using NUnit.Framework;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Screens.Play.HUD;
|
using osu.Game.Screens.Play.HUD;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -66,6 +67,13 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddAssert("is player 2 position #3", () => leaderboard.CheckPositionByUsername("Player 2", 3));
|
AddAssert("is player 2 position #3", () => leaderboard.CheckPositionByUsername("Player 2", 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestRandomScores()
|
||||||
|
{
|
||||||
|
int playerNumber = 1;
|
||||||
|
AddRepeatStep("add player with random score", () => leaderboard.Add(createLeaderboardScore(new BindableDouble(RNG.Next(0, 5_000_000)), $"Player {playerNumber++}")), 10);
|
||||||
|
}
|
||||||
|
|
||||||
private static GameplayLeaderboardScore createLeaderboardScore(BindableDouble score, string username, bool localOrReplayPlayer = false)
|
private static GameplayLeaderboardScore createLeaderboardScore(BindableDouble score, string username, bool localOrReplayPlayer = false)
|
||||||
{
|
{
|
||||||
return new GameplayLeaderboardScore(new User { Username = username }, localOrReplayPlayer)
|
return new GameplayLeaderboardScore(new User { Username = username }, localOrReplayPlayer)
|
||||||
|
Loading…
Reference in New Issue
Block a user