Skip to content

Commit

Permalink
Add tests for the isLevelPicked method.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Sep 30, 2024
1 parent f9c539b commit 414f51f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/MenuTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <catch2/catch_test_macros.hpp>

#include <src/Menu.h>

#include "FakeDisplay.h"

TEST_CASE("Menu usage", "[Menu]")
{
FakeDisplay display;
Menu menu(display);

SECTION("isLevelPicked")
{
REQUIRE(menu.isLevelPicked(UserChoice::LEVEL_1));
REQUIRE(menu.isLevelPicked(UserChoice::LEVEL_2));
REQUIRE(menu.isLevelPicked(UserChoice::LEVEL_3));
REQUIRE(menu.isLevelPicked(UserChoice::LEVEL_4));
REQUIRE(menu.isLevelPicked(UserChoice::LEVEL_MENU) == false);
REQUIRE(menu.isLevelPicked(UserChoice::EXIT) == false);
}
}

0 comments on commit 414f51f

Please sign in to comment.