From e87e4077e82ad92b1fc195df26ff87ee6d13099c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Jun 2019 20:23:43 +0900 Subject: [PATCH] Add testability of dismissal --- .../Visual/UserInterface/TestSceneBackButton.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneBackButton.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneBackButton.cs index 9f627694d8..867b3130c9 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneBackButton.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneBackButton.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; +using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -12,10 +14,15 @@ namespace osu.Game.Tests.Visual.UserInterface { public class TestSceneBackButton : OsuTestScene { + private readonly BackButton button; + + public override IReadOnlyList RequiredTypes => new[] + { + typeof(TwoLayerButton) + }; + public TestSceneBackButton() { - BackButton button; - Child = new Container { Anchor = Anchor.Centre, @@ -32,7 +39,8 @@ public TestSceneBackButton() button = new BackButton { Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft + Origin = Anchor.BottomLeft, + Action = () => button.Hide(), } } };