blob: a7af36afa0226f655e5e92f0193fae2d92ec5803 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#include "catch.hpp"
#include "move.h"
#include <string>
#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");
}
}
}
}
|