From 8dea191998e901c60b1867bd893bcad44c76e958 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 4 Jun 2019 18:37:41 +0300 Subject: [PATCH] Add a testcase --- .../Visual/Online/TestSceneGamemodeControl.cs | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs diff --git a/osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs b/osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs new file mode 100644 index 0000000000..02eaef09b8 --- /dev/null +++ b/osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs @@ -0,0 +1,48 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.MathUtils; +using osu.Game.Graphics; +using osu.Game.Overlays.Profile.Header.Components; +using osuTK.Graphics; +using System; +using System.Collections.Generic; + +namespace osu.Game.Tests.Visual.Online +{ + public class TestSceneGamemodeControl : OsuTestScene + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(GamemodeControl), + typeof(GamemodeTabItem), + }; + + private readonly GamemodeControl control; + + public TestSceneGamemodeControl() + { + Child = control = new GamemodeControl + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }; + + AddStep("set osu! as default", () => control.SetDefaultGamemode("osu")); + AddStep("set mania as default", () => control.SetDefaultGamemode("mania")); + AddStep("set taiko as default", () => control.SetDefaultGamemode("taiko")); + AddStep("set catch as default", () => control.SetDefaultGamemode("fruits")); + AddStep("select default gamemode", () => control.SelectDefaultGamemode()); + + AddStep("set random colour", () => control.AccentColour = new Color4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1)); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + control.AccentColour = colours.Seafoam; + } + } +}