From ac8629e1f8057c3ddc26753feea9f214ca46889a Mon Sep 17 00:00:00 2001 From: Aimee Reincke Date: Mon, 30 Jan 2023 13:47:41 +0100 Subject: [PATCH] invalid user Input --- src/c/ticTacToe.c | 1 + test/c/test_ticTacToe.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/c/ticTacToe.c b/src/c/ticTacToe.c index 5eab4a2..f8d5e1a 100644 --- a/src/c/ticTacToe.c +++ b/src/c/ticTacToe.c @@ -45,4 +45,5 @@ bool validateUserInput(int row, int col){ return true; } } + return false; } \ No newline at end of file diff --git a/test/c/test_ticTacToe.c b/test/c/test_ticTacToe.c index d912a7a..bb0509c 100644 --- a/test/c/test_ticTacToe.c +++ b/test/c/test_ticTacToe.c @@ -24,4 +24,18 @@ void test_ticTacToe_validUserInput(void) TEST_ASSERT_EQUAL_INT(true, result); } +void test_ticTacToe_invalidUserInput(void) +{ + /* arrange */ + bool result; + int row = 1, col = 3; + + /* act */ + result = validateUserInput(row, col); + + /* assert */ + TEST_ASSERT_EQUAL_INT(false, result); +} + + #endif // TEST \ No newline at end of file