From 8a0c79466d8fdf159b07d360b150b27b9e73b23d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 25 Sep 2020 12:16:50 +0900 Subject: [PATCH] Use simplified methods for press/release key --- .../Editor/TestSceneObjectObjectSnap.cs | 32 +++---------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneObjectObjectSnap.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneObjectObjectSnap.cs index da987c7f47..1ca94df26b 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneObjectObjectSnap.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneObjectObjectSnap.cs @@ -34,19 +34,9 @@ public void TestHitCircleSnapsToOtherHitCircle(bool distanceSnapEnabled) AddStep("move mouse to centre", () => InputManager.MoveMouseTo(playfield.ScreenSpaceDrawQuad.Centre)); if (!distanceSnapEnabled) - { - AddStep("disable distance snap", () => - { - InputManager.PressKey(Key.Q); - InputManager.ReleaseKey(Key.Q); - }); - } + AddStep("disable distance snap", () => InputManager.Key(Key.Q)); - AddStep("enter placement mode", () => - { - InputManager.PressKey(Key.Number2); - InputManager.ReleaseKey(Key.Number2); - }); + AddStep("enter placement mode", () => InputManager.Key(Key.Number2)); AddStep("place first object", () => InputManager.Click(MouseButton.Left)); @@ -70,17 +60,9 @@ public void TestHitCircleSnapsToSliderEnd() { AddStep("move mouse to centre", () => InputManager.MoveMouseTo(playfield.ScreenSpaceDrawQuad.Centre)); - AddStep("disable distance snap", () => - { - InputManager.PressKey(Key.Q); - InputManager.ReleaseKey(Key.Q); - }); + AddStep("disable distance snap", () => InputManager.Key(Key.Q)); - AddStep("enter slider placement mode", () => - { - InputManager.PressKey(Key.Number3); - InputManager.ReleaseKey(Key.Number3); - }); + AddStep("enter slider placement mode", () => InputManager.Key(Key.Number3)); AddStep("start slider placement", () => InputManager.Click(MouseButton.Left)); @@ -88,11 +70,7 @@ public void TestHitCircleSnapsToSliderEnd() AddStep("end slider placement", () => InputManager.Click(MouseButton.Right)); - AddStep("enter circle placement mode", () => - { - InputManager.PressKey(Key.Number2); - InputManager.ReleaseKey(Key.Number2); - }); + AddStep("enter circle placement mode", () => InputManager.Key(Key.Number2)); AddStep("move mouse slightly", () => InputManager.MoveMouseTo(playfield.ScreenSpaceDrawQuad.Centre + new Vector2(playfield.ScreenSpaceDrawQuad.Width * 0.20f, 0)));