mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:42:58 +08:00
Add failing beatmap set lookup type test
This commit is contained in:
parent
8e022ad4f9
commit
f8fade7967
@ -14,6 +14,8 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
|
using osu.Game.Online.API;
|
||||||
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Overlays.BeatmapSet.Scores;
|
using osu.Game.Overlays.BeatmapSet.Scores;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
@ -241,6 +243,44 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddStep(@"show without reload", overlay.Show);
|
AddStep(@"show without reload", overlay.Show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase(BeatmapSetLookupType.BeatmapId)]
|
||||||
|
[TestCase(BeatmapSetLookupType.SetId)]
|
||||||
|
public void TestFetchLookupType(BeatmapSetLookupType lookupType)
|
||||||
|
{
|
||||||
|
string type = string.Empty;
|
||||||
|
|
||||||
|
AddStep("register request handling", () =>
|
||||||
|
{
|
||||||
|
((DummyAPIAccess)API).HandleRequest = req =>
|
||||||
|
{
|
||||||
|
switch (req)
|
||||||
|
{
|
||||||
|
case GetBeatmapSetRequest getBeatmapSet:
|
||||||
|
type = getBeatmapSet.Type.ToString();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep(@"fetch", () =>
|
||||||
|
{
|
||||||
|
switch (lookupType)
|
||||||
|
{
|
||||||
|
case BeatmapSetLookupType.BeatmapId:
|
||||||
|
overlay.FetchAndShowBeatmap(55);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BeatmapSetLookupType.SetId:
|
||||||
|
overlay.FetchAndShowBeatmapSet(55);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AddAssert(@"type is correct", () => type == lookupType.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
private APIBeatmapSet createManyDifficultiesBeatmapSet()
|
private APIBeatmapSet createManyDifficultiesBeatmapSet()
|
||||||
{
|
{
|
||||||
var set = getBeatmapSet();
|
var set = getBeatmapSet();
|
||||||
|
Loading…
Reference in New Issue
Block a user