mirror of
https://github.com/ppy/osu
synced 2025-01-11 00:29:30 +00:00
Merge pull request #15630 from peppy/fix-beatmap-recommendations-test
Fix `TestSceneBeatmapRecommendations` testing with an online ID of 0
This commit is contained in:
commit
077d53e3ad
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
@ -102,8 +103,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
BeatmapSetInfo catchSet = null, mixedSet = null;
|
||||
|
||||
AddStep("create catch beatmapset", () => catchSet = importBeatmapSet(0, new[] { new CatchRuleset().RulesetInfo }));
|
||||
AddStep("create mixed beatmapset", () => mixedSet = importBeatmapSet(1,
|
||||
AddStep("create catch beatmapset", () => catchSet = importBeatmapSet(1, new[] { new CatchRuleset().RulesetInfo }));
|
||||
AddStep("create mixed beatmapset", () => mixedSet = importBeatmapSet(2,
|
||||
new[] { new TaikoRuleset().RulesetInfo, new CatchRuleset().RulesetInfo, new ManiaRuleset().RulesetInfo }));
|
||||
|
||||
AddAssert("all sets imported", () => ensureAllBeatmapSetsImported(new[] { catchSet, mixedSet }));
|
||||
@ -120,8 +121,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
BeatmapSetInfo osuSet = null, mixedSet = null;
|
||||
|
||||
AddStep("create osu! beatmapset", () => osuSet = importBeatmapSet(0, new[] { new OsuRuleset().RulesetInfo }));
|
||||
AddStep("create mixed beatmapset", () => mixedSet = importBeatmapSet(1,
|
||||
AddStep("create osu! beatmapset", () => osuSet = importBeatmapSet(1, new[] { new OsuRuleset().RulesetInfo }));
|
||||
AddStep("create mixed beatmapset", () => mixedSet = importBeatmapSet(2,
|
||||
new[] { new TaikoRuleset().RulesetInfo, new CatchRuleset().RulesetInfo, new ManiaRuleset().RulesetInfo }));
|
||||
|
||||
AddAssert("all sets imported", () => ensureAllBeatmapSetsImported(new[] { osuSet, mixedSet }));
|
||||
@ -138,8 +139,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
BeatmapSetInfo osuSet = null, mixedSet = null;
|
||||
|
||||
AddStep("create osu! beatmapset", () => osuSet = importBeatmapSet(0, new[] { new OsuRuleset().RulesetInfo }));
|
||||
AddStep("create mixed beatmapset", () => mixedSet = importBeatmapSet(1,
|
||||
AddStep("create osu! beatmapset", () => osuSet = importBeatmapSet(1, new[] { new OsuRuleset().RulesetInfo }));
|
||||
AddStep("create mixed beatmapset", () => mixedSet = importBeatmapSet(2,
|
||||
new[] { new TaikoRuleset().RulesetInfo, new CatchRuleset().RulesetInfo, new TaikoRuleset().RulesetInfo }));
|
||||
|
||||
AddAssert("all sets imported", () => ensureAllBeatmapSetsImported(new[] { osuSet, mixedSet }));
|
||||
@ -156,8 +157,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
BeatmapSetInfo osuSet = null, maniaSet = null;
|
||||
|
||||
AddStep("create osu! beatmapset", () => osuSet = importBeatmapSet(0, new[] { new OsuRuleset().RulesetInfo }));
|
||||
AddStep("create mania beatmapset", () => maniaSet = importBeatmapSet(1, Enumerable.Repeat(new ManiaRuleset().RulesetInfo, 10)));
|
||||
AddStep("create osu! beatmapset", () => osuSet = importBeatmapSet(1, new[] { new OsuRuleset().RulesetInfo }));
|
||||
AddStep("create mania beatmapset", () => maniaSet = importBeatmapSet(2, Enumerable.Repeat(new ManiaRuleset().RulesetInfo, 10)));
|
||||
|
||||
AddAssert("all sets imported", () => ensureAllBeatmapSetsImported(new[] { osuSet, maniaSet }));
|
||||
|
||||
@ -203,11 +204,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
AddStep("present beatmap", () => Game.PresentBeatmap(getImport()));
|
||||
|
||||
AddUntilStep("wait for song select", () => Game.ScreenStack.CurrentScreen is Screens.Select.SongSelect);
|
||||
AddUntilStep("recommended beatmap displayed", () =>
|
||||
{
|
||||
int? expectedID = getImport().Beatmaps[expectedDiff - 1].OnlineID;
|
||||
return Game.Beatmap.Value.BeatmapInfo.OnlineID == expectedID;
|
||||
});
|
||||
AddUntilStep("recommended beatmap displayed", () => Game.Beatmap.Value.BeatmapInfo.MatchesOnlineID(getImport().Beatmaps[expectedDiff - 1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user