From 40a44357925e9e0479aaf8b315935655e12605eb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 31 Jan 2020 00:33:24 +0900 Subject: [PATCH] Fix chat test intermittently failing Was throwing exception instead of returning false due to LINQ Single() call. --- osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs index 29bda524e8..1561d0d11d 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs @@ -104,7 +104,11 @@ namespace osu.Game.Tests.Visual.Online public void TestSearchInSelector() { AddStep("search for 'test2'", () => chatOverlay.ChildrenOfType().First().Text = "test2"); - AddUntilStep("only channel 2 visible", () => chatOverlay.ChildrenOfType().Single(c => c.IsPresent).Channel == channel2); + AddUntilStep("only channel 2 visible", () => + { + var listItems = chatOverlay.ChildrenOfType().Where(c => c.IsPresent); + return listItems.Count() == 1 && listItems.Single().Channel == channel2; + }); } private void clickDrawable(Drawable d)