From f921aaaf1c1893d1cce3b48aea7023dc6350fa78 Mon Sep 17 00:00:00 2001 From: KaffeeMaus Date: Fri, 26 Jan 2024 11:05:31 +0100 Subject: [PATCH] refactoring: commandHandler --- src/main/c/Georg/tictactoe.c | 2 +- src/main/c/Georg/tictactoe.h | 2 +- src/test/c/Georg/test_tictactoe.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/c/Georg/tictactoe.c b/src/main/c/Georg/tictactoe.c index 961789b..8501c52 100644 --- a/src/main/c/Georg/tictactoe.c +++ b/src/main/c/Georg/tictactoe.c @@ -24,7 +24,7 @@ struct ticTacToe createTicTacToe() { return newGame; } -int handleState( char* input ){ +int handeCommand( char* input ){ if( strcmp(input, "start game") == 0 ){ return 1; } diff --git a/src/main/c/Georg/tictactoe.h b/src/main/c/Georg/tictactoe.h index 2091478..1500ee2 100644 --- a/src/main/c/Georg/tictactoe.h +++ b/src/main/c/Georg/tictactoe.h @@ -8,6 +8,6 @@ struct ticTacToe{ char* getWelcomeMessage(); char* getRulesMessage(); struct ticTacToe createTicTacToe(); -int handleState( char* input ); +int handeCommand( char* input ); #endif //TICTACTOE_H diff --git a/src/test/c/Georg/test_tictactoe.c b/src/test/c/Georg/test_tictactoe.c index cd209a9..8984fb8 100644 --- a/src/test/c/Georg/test_tictactoe.c +++ b/src/test/c/Georg/test_tictactoe.c @@ -51,13 +51,13 @@ void test_initial_state(void){ TEST_ASSERT_EQUAL_INT( expectedState, newGame.currentState ); } -void test_userInput(void){ +void test_command_startGame(void){ // arrange int expectedState = 1; char* input = "start game"; // act - int actualState = handleState( input ); + int actualState = handeCommand( input ); // assert TEST_ASSERT_EQUAL_INT( expectedState, actualState );