mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:02:55 +08:00
Add more comprehensive testing
This commit is contained in:
parent
9433a97747
commit
4f075f4740
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
@ -26,7 +27,6 @@ namespace osu.Game.Tests.Visual
|
||||
PausePlayer pausable() => (PausePlayer)player();
|
||||
|
||||
base.AddCheckSteps(player);
|
||||
//AddUntilStep(() => pausable().ScoreProcessor.TotalScore.Value > 0, "score above zero");
|
||||
|
||||
AddStep("pause", () => pausable().Pause());
|
||||
AddAssert("clock stopped", () => !pausable().GameplayClockContainer.GameplayClock.IsRunning);
|
||||
@ -47,6 +47,17 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
AddAssert("pause overlay hidden", () => !pausable().PauseOverlayVisible);
|
||||
AddAssert("fail overlay still shown", () => pausable().FailOverlayVisible);
|
||||
|
||||
AddStep("restart", () => pausable().Restart());
|
||||
|
||||
AddUntilStep(() =>
|
||||
{
|
||||
pausable().Pause();
|
||||
return pausable().PauseOverlayVisible;
|
||||
}, "keep trying to pause");
|
||||
|
||||
AddStep("exit", () => pausable().Exit());
|
||||
AddUntilStep(() => !pausable().IsCurrentScreen(), "player exited");
|
||||
}
|
||||
|
||||
private class PausePlayer : Player
|
||||
|
@ -158,14 +158,14 @@ namespace osu.Game.Screens.Play
|
||||
},
|
||||
FailOverlay = new FailOverlay
|
||||
{
|
||||
OnRetry = restart,
|
||||
OnRetry = Restart,
|
||||
OnQuit = performUserRequestedExit,
|
||||
},
|
||||
PauseOverlay = new PauseOverlay
|
||||
{
|
||||
OnResume = Resume,
|
||||
Retries = RestartCount,
|
||||
OnRetry = restart,
|
||||
OnRetry = Restart,
|
||||
OnQuit = performUserRequestedExit,
|
||||
},
|
||||
new HotkeyRetryOverlay
|
||||
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Play
|
||||
if (!this.IsCurrentScreen()) return;
|
||||
|
||||
fadeOut(true);
|
||||
restart();
|
||||
Restart();
|
||||
},
|
||||
}
|
||||
};
|
||||
@ -246,7 +246,7 @@ namespace osu.Game.Screens.Play
|
||||
this.Exit();
|
||||
}
|
||||
|
||||
private void restart()
|
||||
public void Restart()
|
||||
{
|
||||
if (!this.IsCurrentScreen()) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user