|
|
|
#include <catch2/catch_test_macros.hpp>
|
|
|
|
#include "../game_engine.hpp"
|
|
|
|
#include <fmt/core.h>
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|