From 6af033acba84d937969816f61e766cc57ac25371 Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 8 Jun 2024 09:34:31 -0600 Subject: [PATCH] Fixed Scenario Tests --- UnitTests/UICatalog/ScenarioTests.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/UnitTests/UICatalog/ScenarioTests.cs b/UnitTests/UICatalog/ScenarioTests.cs index facf601b2..d5388a0cf 100644 --- a/UnitTests/UICatalog/ScenarioTests.cs +++ b/UnitTests/UICatalog/ScenarioTests.cs @@ -44,17 +44,6 @@ public class ScenarioTests : TestsAllViews //FakeConsole.PushMockKeyPress (Key.Space); FakeConsole.PushMockKeyPress ((KeyCode)Application.QuitKey); - // The only key we care about is the QuitKey - Application.KeyDown += (sender, args) => - { - _output.WriteLine ($" Keypress: {args.KeyCode}"); - - // BUGBUG: (#2474) For some reason ReadKey is not returning the QuitKey for some Scenarios - // by adding this Space it seems to work. - // See #2474 for why this is commented out - Assert.Equal (Application.QuitKey.KeyCode, args.KeyCode); - }; - uint abortTime = 500; // If the scenario doesn't close within 500ms, this will force it to quit @@ -77,6 +66,9 @@ public class ScenarioTests : TestsAllViews Application.Iteration += (s, a) => { + // Press QuitKey + Assert.Empty (FakeConsole.MockKeyPresses); + FakeConsole.PushMockKeyPress ((KeyCode)Application.QuitKey); //output.WriteLine ($" iteration {++iterations}"); if (Application.Top.Running && FakeConsole.MockKeyPresses.Count == 0) {