1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:43:20 +08:00

Tidy up tests (and remove duplicate with new call logic)

This commit is contained in:
Dean Herbert 2021-02-15 16:11:17 +09:00
parent 9cba350337
commit f664fca0dd

View File

@ -90,20 +90,6 @@ namespace osu.Game.Tests.Visual.Gameplay
resumeAndConfirm();
}
[Test]
public void TestExternalPauseDuringCooldownTooSoon()
{
AddStep("move cursor outside", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopLeft - new Vector2(10)));
pauseAndConfirm();
resume();
pauseExternally();
confirmResumed();
confirmNotExited();
}
[Test]
public void TestUserPauseDuringCooldownTooSoon()
{
@ -112,7 +98,7 @@ namespace osu.Game.Tests.Visual.Gameplay
pauseAndConfirm();
resume();
AddStep("pause via exit key", () => Player.ExitViaPause());
pauseFromUserExitKey();
confirmResumed();
confirmNotExited();
@ -154,7 +140,7 @@ namespace osu.Game.Tests.Visual.Gameplay
confirmClockRunning(false);
pauseExternally();
pauseFromUserExitKey();
confirmPausedWithNoOverlay();
AddAssert("fail overlay still shown", () => Player.FailOverlayVisible);
@ -266,7 +252,7 @@ namespace osu.Game.Tests.Visual.Gameplay
private void pauseAndConfirm()
{
pauseExternally();
pauseFromUserExitKey();
confirmPaused();
}
@ -313,7 +299,7 @@ namespace osu.Game.Tests.Visual.Gameplay
}
private void restart() => AddStep("restart", () => Player.Restart());
private void pauseExternally() => AddStep("pause", () => Player.Pause());
private void pauseFromUserExitKey() => AddStep("user pause", () => Player.ExitViaPause());
private void resume() => AddStep("resume", () => Player.Resume());
private void confirmPauseOverlayShown(bool isShown) =>