mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Fix wrong counting and add test
This commit is contained in:
@ -43,6 +43,29 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
exitViaEscapeAndConfirm();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestRetryCountIncrements()
|
||||
{
|
||||
Player player = null;
|
||||
|
||||
PushAndConfirm(() => new TestSongSelect());
|
||||
|
||||
AddStep("import beatmap", () => ImportBeatmapTest.LoadQuickOszIntoOsu(Game).Wait());
|
||||
|
||||
AddUntilStep("wait for selected", () => !Game.Beatmap.IsDefault);
|
||||
|
||||
AddStep("press enter", () => InputManager.Key(Key.Enter));
|
||||
|
||||
AddUntilStep("wait for player", () => (player = Game.ScreenStack.CurrentScreen as Player) != null);
|
||||
AddAssert("retry count is 0", () => player.RestartCount == 0);
|
||||
|
||||
AddStep("attempt to retry", () => player.ChildrenOfType<HotkeyRetryOverlay>().First().Action());
|
||||
AddUntilStep("wait for old player gone", () => Game.ScreenStack.CurrentScreen != player);
|
||||
|
||||
AddUntilStep("get new player", () => (player = Game.ScreenStack.CurrentScreen as Player) != null);
|
||||
AddAssert("retry count is 1", () => player.RestartCount == 1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestRetryFromResults()
|
||||
{
|
||||
|
Reference in New Issue
Block a user