diff --git a/src/main/c/labyrinth.c b/src/main/c/labyrinth.c index d53c95b..a76a53b 100644 --- a/src/main/c/labyrinth.c +++ b/src/main/c/labyrinth.c @@ -16,5 +16,8 @@ void turn_direction_right(Direction *direction){ case S: *direction = W; break; + case W: + *direction = N; + break; } } diff --git a/src/test/c/test_labyrinth.c b/src/test/c/test_labyrinth.c index 555736d..e257b07 100644 --- a/src/test/c/test_labyrinth.c +++ b/src/test/c/test_labyrinth.c @@ -51,3 +51,16 @@ void test_turn_direction_right_from_S_expected_W(void) TEST_ASSERT_TRUE(expected == actual); } +void test_turn_direction_right_from_W_expected_N(void) +{ + /* arrange */ + Direction actual = W; + Direction expected = N; + + /* act */ + turn_direction_right(&actual); + + /* assert */ + TEST_ASSERT_TRUE(expected == actual); +} +