From 5f792fbacc945f6a5e6e0c7e71aca3896bd1f8e8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Feb 2019 14:28:53 +0900 Subject: [PATCH] Fix tests not running more than once --- .../TestCaseSliderInput.cs | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderInput.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderInput.cs index 39dc914406..1e469b7d12 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderInput.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderInput.cs @@ -317,32 +317,32 @@ private void performTest(List frames) // Likely requires some discussion regarding how first frame inputs should be handled. frames.Insert(0, new OsuReplayFrame()); - var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } }) - { - AllowPause = false, - AllowLeadIn = false, - AllowResults = false - }; - - p.OnLoadComplete += _ => - { - p.ScoreProcessor.NewJudgement += result => - { - if (currentPlayer == p) judgementResults.Add(result); - }; - p.ScoreProcessor.AllJudged += () => - { - if (currentPlayer == p) allJudgedFired = true; - }; - }; - AddStep("load player", () => { + var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } }) + { + AllowPause = false, + AllowLeadIn = false, + AllowResults = false + }; + + p.OnLoadComplete += _ => + { + p.ScoreProcessor.NewJudgement += result => + { + if (currentPlayer == p) judgementResults.Add(result); + }; + p.ScoreProcessor.AllJudged += () => + { + if (currentPlayer == p) allJudgedFired = true; + }; + }; + LoadScreen(currentPlayer = p); allJudgedFired = false; judgementResults = new List(); }); - AddUntilStep(() => p.IsLoaded, "Wait until player is loaded"); + AddUntilStep(() => currentPlayer.IsLoaded, "Wait until player is loaded"); AddUntilStep(() => allJudgedFired, "Wait for all judged"); }