From 3e67763ee8ca5b8ac575fb17385c377f8515c1a2 Mon Sep 17 00:00:00 2001 From: przemek83 <4788832+przemek83@users.noreply.github.com> Date: Thu, 3 Oct 2024 08:17:47 +0200 Subject: [PATCH] Tests for options menu. --- test/MenuTest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/MenuTest.cpp b/test/MenuTest.cpp index 233f7c5..a6e47ef 100644 --- a/test/MenuTest.cpp +++ b/test/MenuTest.cpp @@ -73,6 +73,22 @@ TEST_CASE("Menu usage", "[Menu]") REQUIRE(choice == UserChoice::LEVEL_1); } + SECTION("getUserChoice back in options menu") + { + menu.refresh(UserChoice::OPTIONS_MENU); + FakeInput input{{InputAction::BACK}, {}, {}}; + UserChoice choice{menu.getUserChoice(input)}; + REQUIRE(choice == UserChoice::BACK); + } + + SECTION("getUserChoice accept in options menu") + { + menu.refresh(UserChoice::OPTIONS_MENU); + FakeInput input{{InputAction::ACCEPT}, {}, {}}; + UserChoice choice{menu.getUserChoice(input)}; + REQUIRE(choice == UserChoice::FULLSCREEN); + } + SECTION("getUserChoice down and accept in level menu") { menu.refresh(UserChoice::LEVEL_MENU);