mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 00:42:57 +08:00
Clear previous score items on SetUp
This commit is contained in:
parent
32498d5d50
commit
77aa3a9fe5
@ -40,6 +40,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddSliderStep("set player score", 50, 5000000, 1222333, v => playerScore.Value = v);
|
AddSliderStep("set player score", 50, 5000000, 1222333, v => playerScore.Value = v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void SetUp() => leaderboard.ClearScores();
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestPlayerScore()
|
public void TestPlayerScore()
|
||||||
{
|
{
|
||||||
@ -66,6 +69,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
private class TestInGameLeaderboard : InGameLeaderboard
|
private class TestInGameLeaderboard : InGameLeaderboard
|
||||||
{
|
{
|
||||||
|
public void ClearScores() => ScoresContainer.RemoveAll(s => s.User.Username != PlayerUser.Username);
|
||||||
|
|
||||||
public bool CheckPositionByUsername(string username, int? estimatedPosition)
|
public bool CheckPositionByUsername(string username, int? estimatedPosition)
|
||||||
{
|
{
|
||||||
var scoreItem = ScoresContainer.Where(i => i.User.Username == username).FirstOrDefault();
|
var scoreItem = ScoresContainer.Where(i => i.User.Username == username).FirstOrDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user