From 8eebf1079fbed2848ee47cf990f5def5926a0c1f Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Tue, 19 Apr 2022 21:24:15 +0200 Subject: Refile for merging repos --- 2015-spacebot/test/move_string_mapper.cpp | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 2015-spacebot/test/move_string_mapper.cpp (limited to '2015-spacebot/test/move_string_mapper.cpp') diff --git a/2015-spacebot/test/move_string_mapper.cpp b/2015-spacebot/test/move_string_mapper.cpp new file mode 100644 index 0000000..a7af36a --- /dev/null +++ b/2015-spacebot/test/move_string_mapper.cpp @@ -0,0 +1,38 @@ +#include "catch.hpp" +#include "move.h" +#include +#include "move_string_mapper.h" + +SCENARIO("Writing a move") +{ + GIVEN("A Move") + { + Move move = Move::MOVE_LEFT; + + WHEN("It is mapped to a string") + { + std::string moveString = MoveStringMapper().toString(move); + + THEN("The string is correct") + { + REQUIRE(moveString == "MoveLeft"); + } + } + + } + + GIVEN("Build missle controller move") + { + Move move = Move::BUILD_MISSILE_CONTROLLER; + + WHEN("It is mapped to a string") + { + std::string moveString = MoveStringMapper().toString(move); + + THEN("The string is correct") + { + REQUIRE(moveString == "BuildMissileController"); + } + } + } +} -- cgit v1.2.3