GameEngine is now a state machine so I can push its design further and keep it solid.
This commit is contained in:
parent
1c89afaee2
commit
9e6c05eccd
5 changed files with 56 additions and 56 deletions
|
@ -7,32 +7,11 @@ using namespace fmt;
|
|||
TEST_CASE("game engine can start and take hit", "[game_engine]") {
|
||||
// test fails on purpose right now
|
||||
GameEngine game{4};
|
||||
std::string err{"error"};
|
||||
game.start_round();
|
||||
game.hit(err);
|
||||
game.end_round();
|
||||
REQUIRE(game.is_dead() == true);
|
||||
REQUIRE(!game.is_dead() == true);
|
||||
}
|
||||
|
||||
TEST_CASE("", "[game_engine]") {
|
||||
// test fails on purpose right now
|
||||
GameEngine game{100};
|
||||
std::string err{"error"};
|
||||
|
||||
game.start_round();
|
||||
game.hit(err);
|
||||
game.end_round();
|
||||
|
||||
REQUIRE(game.hit_points < 100);
|
||||
REQUIRE(game.rounds == 1);
|
||||
REQUIRE(game.streak == 0);
|
||||
REQUIRE(game.is_dead() == false);
|
||||
|
||||
game.start_round();
|
||||
game.end_round();
|
||||
|
||||
REQUIRE(game.hit_points == 100);
|
||||
REQUIRE(game.rounds == 2);
|
||||
REQUIRE(game.streak == 1);
|
||||
REQUIRE(game.is_dead() == false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue