1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-31 06:52:53 +08:00

Clear previous score items on SetUp

This commit is contained in:
iiSaLMaN 2019-07-30 12:37:01 +03:00
parent 32498d5d50
commit 77aa3a9fe5

View File

@ -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();