From 4b459b4f67ab5296f647a98b109f337cb5cb537e Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sat, 24 Sep 2016 08:57:13 +0800 Subject: [PATCH] Visual test for KeyCounter. --- .../Tests/TestCaseKeyCounter.cs | 32 +++++++++++++++++++ .../osu.Desktop.VisualTests.csproj | 1 + 2 files changed, 33 insertions(+) create mode 100644 osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs new file mode 100644 index 0000000000..d2184a04c9 --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs @@ -0,0 +1,32 @@ +using System; +using OpenTK.Input; +using osu.Framework.GameModes.Testing; +using osu.Framework.Graphics; +using osu.Game.Graphics.UserInterface; + +namespace osu.Desktop.Tests +{ + class TestCaseKeyCounter : TestCase + { + public override string Name => @"KeyCounter"; + + public override string Description => @"Tests key counter"; + + public override void Reset() + { + base.Reset(); + + KeyCounter kc = new KeyCounter + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + IsCounting = true + }; + Add(kc); + kc.AddKey(new KeyBoardCount(@"Z", Key.Z)); + kc.AddKey(new KeyBoardCount(@"X", Key.X)); + kc.AddKey(new MouseCount(@"M1", MouseButton.Left)); + kc.AddKey(new MouseCount(@"M2", MouseButton.Right)); + } + } +} diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 4430339937..8cb922cfee 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -147,6 +147,7 @@ +