From f21465727e9884199d8a72febbf7d38b988576b5 Mon Sep 17 00:00:00 2001 From: Joe Lukas Kalb Date: Tue, 6 Feb 2024 18:14:53 +0100 Subject: [PATCH] change direction right E --> S --- src/main/c/labyrinth.c | 3 +++ src/test/c/test_labyrinth.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) 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); +}