mirror of
https://github.com/ppy/osu
synced 2025-01-18 20:10:49 +00: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.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
@ -66,6 +67,13 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
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)
|
||||
{
|
||||
return new GameplayLeaderboardScore(new User { Username = username }, localOrReplayPlayer)
|
||||
|
Loading…
Reference in New Issue
Block a user