mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:02:53 +08:00
Add leaderboard test on beatmap update
This commit is contained in:
parent
7e127dafe2
commit
338d96534a
@ -96,6 +96,37 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
checkCount(0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLocalScoresDisplayOnBeatmapEdit()
|
||||
{
|
||||
BeatmapInfo beatmapInfo = null!;
|
||||
|
||||
AddStep(@"Set scope", () => leaderboard.Scope = BeatmapLeaderboardScope.Local);
|
||||
|
||||
AddStep(@"Set beatmap", () =>
|
||||
{
|
||||
beatmapManager.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely();
|
||||
beatmapInfo = beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps.First();
|
||||
|
||||
leaderboard.BeatmapInfo = beatmapInfo;
|
||||
});
|
||||
|
||||
clearScores();
|
||||
checkCount(0);
|
||||
|
||||
loadMoreScores(() => beatmapInfo);
|
||||
checkCount(10);
|
||||
|
||||
beatmapEdit(() => beatmapInfo);
|
||||
checkCount(0);
|
||||
|
||||
loadMoreScores(() => beatmapInfo);
|
||||
checkCount(10);
|
||||
|
||||
clearScores();
|
||||
checkCount(0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestGlobalScoresDisplay()
|
||||
{
|
||||
@ -123,6 +154,21 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
AddStep(@"None selected", () => leaderboard.SetErrorState(LeaderboardState.NoneSelected));
|
||||
}
|
||||
|
||||
private void beatmapEdit(Func<BeatmapInfo> beatmapInfo)
|
||||
{
|
||||
AddStep(@"Update beatmap via BeatmapManager", () =>
|
||||
{
|
||||
BeatmapInfo info = beatmapInfo();
|
||||
IBeatmap beatmap = beatmapManager.GetWorkingBeatmap(info).Beatmap;
|
||||
|
||||
beatmap.Difficulty.ApproachRate = 11;
|
||||
beatmap.Difficulty.DrainRate = 11;
|
||||
beatmap.Difficulty.OverallDifficulty = 11;
|
||||
|
||||
beatmapManager.Save(info, beatmap);
|
||||
});
|
||||
}
|
||||
|
||||
private void showPersonalBestWithNullPosition()
|
||||
{
|
||||
leaderboard.SetScores(leaderboard.Scores, new ScoreInfo
|
||||
|
Loading…
Reference in New Issue
Block a user