osu/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs

43 lines
1.3 KiB
C#
Raw Normal View History

2017-02-16 20:05:03 +00:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-04-17 08:43:48 +00:00
using osu.Framework.Allocation;
2017-02-16 20:05:03 +00:00
using osu.Framework.Graphics;
using osu.Game.Overlays.Mods;
2017-03-28 12:03:34 +00:00
using osu.Framework.Testing;
2017-04-17 08:43:48 +00:00
using osu.Game.Database;
2017-02-16 20:05:03 +00:00
namespace osu.Desktop.VisualTests.Tests
{
2017-03-07 01:59:19 +00:00
internal class TestCaseModSelectOverlay : TestCase
2017-02-16 20:05:03 +00:00
{
public override string Description => @"Tests the mod select overlay";
2017-02-16 20:05:03 +00:00
private ModSelectOverlay modSelect;
2017-04-17 08:43:48 +00:00
private RulesetDatabase rulesets;
[BackgroundDependencyLoader]
private void load(RulesetDatabase rulesets)
{
this.rulesets = rulesets;
}
2017-02-16 20:05:03 +00:00
public override void Reset()
{
base.Reset();
Add(modSelect = new ModSelectOverlay
2017-02-16 20:05:03 +00:00
{
RelativeSizeAxes = Axes.X,
2017-02-16 20:05:03 +00:00
Origin = Anchor.BottomCentre,
Anchor = Anchor.BottomCentre,
});
2017-03-31 08:55:07 +00:00
AddStep("Toggle", modSelect.ToggleVisibility);
2017-04-14 20:22:41 +00:00
2017-04-17 08:43:48 +00:00
foreach (var ruleset in rulesets.AllRulesets)
AddStep(ruleset.CreateInstance().Description, () => modSelect.Ruleset.Value = ruleset);
2017-02-16 20:05:03 +00:00
}
}
}