diff --git a/src/main/c/labyrinth.c b/src/main/c/labyrinth.c index 980b367..adaaab5 100644 --- a/src/main/c/labyrinth.c +++ b/src/main/c/labyrinth.c @@ -10,5 +10,8 @@ void turn_direction_right(Direction *direction){ case N: *direction = E; break; + case E: + *direction = S; + break; } } diff --git a/src/test/c/test_labyrinth.c b/src/test/c/test_labyrinth.c index a31da00..563d886 100644 --- a/src/test/c/test_labyrinth.c +++ b/src/test/c/test_labyrinth.c @@ -25,3 +25,15 @@ void test_change_direction_from_N_expected_E(void) TEST_ASSERT_TRUE(expected == actual); } +void test_turn_direction_right_from_E_expected_S(void) +{ + /* arrange */ + Direction actual = E; + Direction expected = S; + + /* act */ + turn_direction_right(&actual); + + /* assert */ + TEST_ASSERT_TRUE(expected == actual); +}