From 99405a2bbd38e999672d0fe89c83e56b845a0bdf Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 5 Nov 2023 06:28:34 +0300 Subject: [PATCH] Tidy up resume overlay test scene --- .../TestSceneResumeOverlay.cs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneResumeOverlay.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneResumeOverlay.cs index 0bb27cff0f..81dc64cda9 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneResumeOverlay.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneResumeOverlay.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using NUnit.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; @@ -12,14 +13,15 @@ namespace osu.Game.Rulesets.Osu.Tests { public partial class TestSceneResumeOverlay : OsuManualInputManagerTestScene { - public TestSceneResumeOverlay() + private ManualOsuInputManager osuInputManager = null!; + private CursorContainer cursor = null!; + private ResumeOverlay resume = null!; + + private bool resumeFired; + + [SetUp] + public void SetUp() => Schedule(() => { - ManualOsuInputManager osuInputManager; - CursorContainer cursor; - ResumeOverlay resume; - - bool resumeFired = false; - Child = osuInputManager = new ManualOsuInputManager(new OsuRuleset().RulesetInfo) { Children = new Drawable[] @@ -32,8 +34,13 @@ namespace osu.Game.Rulesets.Osu.Tests } }; + resumeFired = false; resume.ResumeAction = () => resumeFired = true; + }); + [Test] + public void TestResume() + { AddStep("move mouse to center", () => InputManager.MoveMouseTo(ScreenSpaceDrawQuad.Centre)); AddStep("show", () => resume.Show());