mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Create ManualInputManagerTestCase
A base class for running more input-driven tests.
This commit is contained in:
29
osu.Game/Tests/Visual/ManualInputManagerTestCase.cs
Normal file
29
osu.Game/Tests/Visual/ManualInputManagerTestCase.cs
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing.Input;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public abstract class ManualInputManagerTestCase : OsuTestCase
|
||||
{
|
||||
protected override Container<Drawable> Content => InputManager;
|
||||
protected readonly ManualInputManager InputManager;
|
||||
|
||||
protected ManualInputManagerTestCase()
|
||||
{
|
||||
base.Content.Add(InputManager = new ManualInputManager());
|
||||
ReturnUserInput();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns input back to the user.
|
||||
/// </summary>
|
||||
protected void ReturnUserInput()
|
||||
{
|
||||
AddStep("Return user input", () => InputManager.UseParentState = true);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user