1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 01:47:33 +08:00

Update tests

This commit is contained in:
Dean Herbert 2019-09-19 15:23:37 +09:00
parent 098e89cb66
commit 9b35de9ce1

View File

@ -5,8 +5,12 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Leaderboards; using osu.Game.Online.Leaderboards;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Screens.Select.Details;
using osu.Game.Screens.Select.Leaderboards; using osu.Game.Screens.Select.Leaderboards;
using osu.Game.Users; using osu.Game.Users;
using osuTK; using osuTK;
@ -20,6 +24,8 @@ namespace osu.Game.Tests.Visual.SongSelect
typeof(Placeholder), typeof(Placeholder),
typeof(MessagePlaceholder), typeof(MessagePlaceholder),
typeof(RetrievalFailurePlaceholder), typeof(RetrievalFailurePlaceholder),
typeof(UserTopScoreContainer),
typeof(Leaderboard<BeatmapLeaderboardScope, ScoreInfo>),
}; };
private readonly FailableLeaderboard leaderboard; private readonly FailableLeaderboard leaderboard;
@ -35,6 +41,7 @@ namespace osu.Game.Tests.Visual.SongSelect
}); });
AddStep(@"New Scores", newScores); AddStep(@"New Scores", newScores);
AddStep(@"Show personal best", showPersonalBest);
AddStep(@"Empty Scores", () => leaderboard.SetRetrievalState(PlaceholderState.NoScores)); AddStep(@"Empty Scores", () => leaderboard.SetRetrievalState(PlaceholderState.NoScores));
AddStep(@"Network failure", () => leaderboard.SetRetrievalState(PlaceholderState.NetworkFailure)); AddStep(@"Network failure", () => leaderboard.SetRetrievalState(PlaceholderState.NetworkFailure));
AddStep(@"No supporter", () => leaderboard.SetRetrievalState(PlaceholderState.NotSupporter)); AddStep(@"No supporter", () => leaderboard.SetRetrievalState(PlaceholderState.NotSupporter));
@ -45,6 +52,32 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep($"{status} beatmap", () => showBeatmapWithStatus(status)); AddStep($"{status} beatmap", () => showBeatmapWithStatus(status));
} }
private void showPersonalBest()
{
leaderboard.TopScore = new APILegacyUserTopScoreInfo
{
Position = 999,
Score = new APILegacyScoreInfo
{
Rank = ScoreRank.XH,
Accuracy = 1,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 6602580,
Username = @"waaiiru",
Country = new Country
{
FullName = @"Spain",
FlagName = @"ES",
},
},
}
};
}
private void newScores() private void newScores()
{ {
var scores = new[] var scores = new[]