1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 09:02:58 +08:00

Refactor beatmap set overlay test scene

This commit is contained in:
smoogipoo 2019-06-13 18:14:57 +09:00
parent f54f6e552b
commit 72f729cf3b

View File

@ -41,6 +41,9 @@ namespace osu.Game.Tests.Visual.Online
typeof(SuccessRate),
};
private RulesetInfo maniaRuleset;
private RulesetInfo taikoRuleset;
public TestSceneBeatmapSetOverlay()
{
Add(overlay = new BeatmapSetOverlay());
@ -49,13 +52,25 @@ namespace osu.Game.Tests.Visual.Online
[BackgroundDependencyLoader]
private void load(RulesetStore rulesets)
{
var mania = rulesets.GetRuleset(3);
var taiko = rulesets.GetRuleset(1);
maniaRuleset = rulesets.GetRuleset(3);
taikoRuleset = rulesets.GetRuleset(1);
}
[Test]
public void TestLoading()
{
AddStep(@"show loading", () => overlay.ShowBeatmapSet(null));
}
[Test]
public void TestOnline()
{
AddStep(@"show online", () => overlay.FetchAndShowBeatmapSet(55));
}
[Test]
public void TestLocalBeatmaps()
{
AddStep(@"show first", () =>
{
overlay.ShowBeatmapSet(new BeatmapSetInfo
@ -94,7 +109,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 1.36,
Version = @"BASIC",
Ruleset = mania,
Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 4,
@ -120,7 +135,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 2.22,
Version = @"NOVICE",
Ruleset = mania,
Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 4,
@ -146,7 +161,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 3.49,
Version = @"ADVANCED",
Ruleset = mania,
Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 4,
@ -172,7 +187,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 4.24,
Version = @"EXHAUST",
Ruleset = mania,
Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 4,
@ -198,7 +213,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 5.26,
Version = @"GRAVITY",
Ruleset = mania,
Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 4,
@ -261,7 +276,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 1.40,
Version = @"yzrin's Kantan",
Ruleset = taiko,
Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 2,
@ -287,7 +302,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 2.23,
Version = @"Futsuu",
Ruleset = taiko,
Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 2,
@ -313,7 +328,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 3.19,
Version = @"Muzukashii",
Ruleset = taiko,
Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 2,
@ -339,7 +354,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 3.97,
Version = @"Charlotte's Oni",
Ruleset = taiko,
Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 5,
@ -365,7 +380,7 @@ namespace osu.Game.Tests.Visual.Online
{
StarDifficulty = 5.08,
Version = @"Labyrinth Oni",
Ruleset = taiko,
Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 5,
@ -390,8 +405,17 @@ namespace osu.Game.Tests.Visual.Online
},
});
});
}
[Test]
public void TestHide()
{
AddStep(@"hide", overlay.Hide);
}
[Test]
public void TestShowWithNoReload()
{
AddStep(@"show without reload", overlay.Show);
}
}