2023-02-14 06:55:13 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Game.Rulesets.Osu.Mods;
|
|
|
|
using osuTK.Input;
|
|
|
|
|
2023-02-14 14:07:45 +08:00
|
|
|
namespace osu.Game.Rulesets.Osu.Tests.Mods
|
2023-02-14 06:55:13 +08:00
|
|
|
{
|
2023-02-14 14:07:45 +08:00
|
|
|
public partial class TestSceneOsuModAutopilot : OsuModTestScene
|
2023-02-14 06:55:13 +08:00
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void TestInstantResume()
|
|
|
|
{
|
2023-02-14 14:07:45 +08:00
|
|
|
CreateModTest(new ModTestData
|
|
|
|
{
|
|
|
|
Mod = new OsuModAutopilot(),
|
|
|
|
PassCondition = () => true,
|
|
|
|
Autoplay = false,
|
|
|
|
});
|
2023-02-14 06:55:13 +08:00
|
|
|
|
2023-02-14 14:07:45 +08:00
|
|
|
AddUntilStep("wait for gameplay start", () => Player.LocalUserPlaying.Value);
|
2023-02-14 06:55:13 +08:00
|
|
|
AddStep("press pause", () => InputManager.PressKey(Key.Escape));
|
|
|
|
AddUntilStep("wait until paused", () => Player.GameplayClockContainer.IsPaused.Value);
|
|
|
|
AddStep("release pause", () => InputManager.ReleaseKey(Key.Escape));
|
|
|
|
AddStep("press resume", () => InputManager.PressKey(Key.Escape));
|
|
|
|
AddUntilStep("wait for resume", () => !Player.IsResuming);
|
|
|
|
AddAssert("resumed", () => !Player.GameplayClockContainer.IsPaused.Value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|