1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:32:55 +08:00

Add test coverage for per-ruleset setup screens

This commit is contained in:
Dean Herbert 2021-09-05 13:40:58 +09:00
parent 1a26658ba4
commit 6e4efdd1b1

View File

@ -4,8 +4,13 @@
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Catch;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Mania;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Rulesets.Taiko;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Setup;
@ -23,15 +28,31 @@ namespace osu.Game.Tests.Visual.Editing
editorBeatmap = new EditorBeatmap(new OsuBeatmap());
}
[BackgroundDependencyLoader]
private void load()
{
Beatmap.Value = CreateWorkingBeatmap(editorBeatmap.PlayableBeatmap);
[Test]
public void TestOsu() => runForRuleset(new OsuRuleset().RulesetInfo);
Child = new SetupScreen
[Test]
public void TestTaiko() => runForRuleset(new TaikoRuleset().RulesetInfo);
[Test]
public void TestCatch() => runForRuleset(new CatchRuleset().RulesetInfo);
[Test]
public void TestMania() => runForRuleset(new ManiaRuleset().RulesetInfo);
private void runForRuleset(RulesetInfo rulesetInfo)
{
AddStep("create screen", () =>
{
State = { Value = Visibility.Visible },
};
editorBeatmap.BeatmapInfo.Ruleset = rulesetInfo;
Beatmap.Value = CreateWorkingBeatmap(editorBeatmap.PlayableBeatmap);
Child = new SetupScreen
{
State = { Value = Visibility.Visible },
};
});
}
}
}