Simplify logic and add test coverage for remaining case

This commit is contained in:
Dean Herbert
2019-10-10 20:12:47 +09:00
parent a819a64036
commit 5eba33e876
3 changed files with 13 additions and 10 deletions

View File

@ -92,8 +92,9 @@ namespace osu.Game.Tests.Visual.Menus
exitViaEscapeAndConfirm();
}
[Test]
public void TestSongContinuesAfterExitPlayer()
[TestCase(true)]
[TestCase(false)]
public void TestSongContinuesAfterExitPlayer(bool withUserPause)
{
Player player = null;
@ -106,6 +107,9 @@ namespace osu.Game.Tests.Visual.Menus
AddUntilStep("wait for selected", () => !game.Beatmap.IsDefault);
if (withUserPause)
AddStep("pause", () => game.Dependencies.Get<MusicController>().Stop());
AddStep("press enter", () => pressAndRelease(Key.Enter));
AddUntilStep("wait for player", () => (player = game.ScreenStack.CurrentScreen as Player) != null);