mirror of
https://github.com/ppy/osu
synced 2024-12-12 01:48:49 +00:00
Refactor some shared code in TestScenePause
This commit is contained in:
parent
94f35825dd
commit
a4dc544235
@ -56,9 +56,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
pauseAndConfirm();
|
||||
resume();
|
||||
|
||||
confirmClockRunning(false);
|
||||
confirmPauseOverlayShown(false);
|
||||
|
||||
confirmPausedWithNoOverlay();
|
||||
AddStep("click to resume", () => InputManager.Click(MouseButton.Left));
|
||||
|
||||
confirmClockRunning(true);
|
||||
@ -73,9 +71,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
pauseAndConfirm();
|
||||
|
||||
resume();
|
||||
confirmClockRunning(false);
|
||||
confirmPauseOverlayShown(false);
|
||||
|
||||
confirmPausedWithNoOverlay();
|
||||
pauseAndConfirm();
|
||||
|
||||
AddUntilStep("resume overlay is not active", () => Player.DrawableRuleset.ResumeOverlay.State.Value == Visibility.Hidden);
|
||||
@ -94,7 +90,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPauseTooSoon()
|
||||
public void TestPauseDuringCooldownTooSoon()
|
||||
{
|
||||
AddStep("move cursor outside", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopLeft - new Vector2(10)));
|
||||
|
||||
@ -103,8 +99,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
resume();
|
||||
pause();
|
||||
|
||||
confirmClockRunning(true);
|
||||
confirmPauseOverlayShown(false);
|
||||
confirmResumed();
|
||||
AddAssert("not exited", () => Player.IsCurrentScreen());
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -117,9 +113,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
AddStep("exit quick", () => Player.Exit());
|
||||
|
||||
confirmClockRunning(true);
|
||||
confirmPauseOverlayShown(false);
|
||||
|
||||
confirmResumed();
|
||||
AddAssert("exited", () => !Player.IsCurrentScreen());
|
||||
}
|
||||
|
||||
@ -133,9 +127,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
pause();
|
||||
|
||||
confirmClockRunning(false);
|
||||
confirmPauseOverlayShown(false);
|
||||
|
||||
confirmPausedWithNoOverlay();
|
||||
AddAssert("fail overlay still shown", () => Player.FailOverlayVisible);
|
||||
|
||||
exitAndConfirm();
|
||||
@ -277,6 +269,12 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
confirmPauseOverlayShown(false);
|
||||
}
|
||||
|
||||
private void confirmPausedWithNoOverlay()
|
||||
{
|
||||
confirmClockRunning(false);
|
||||
confirmPauseOverlayShown(false);
|
||||
}
|
||||
|
||||
private void confirmExited()
|
||||
{
|
||||
AddUntilStep("player exited", () => !Player.IsCurrentScreen());
|
||||
|
Loading…
Reference in New Issue
Block a user