// 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.Game.Screens; namespace osu.Game.Tests.Visual { /// /// A test case which can be used to test a screen (that relies on OnEntering being called to execute startup instructions). /// public abstract class ScreenTestCase : OsuTestCase { private OsuScreenStack stack; [BackgroundDependencyLoader] private void load() { Add(stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }); } protected void LoadScreen(OsuScreen screen) { if (stack.CurrentScreen != null) stack.Exit(); stack.Push(screen); } } }