diff --git a/src/main/c/Georg/tictactoe.h b/src/main/c/Georg/tictactoe.h index a0c5870..d8c22f2 100644 --- a/src/main/c/Georg/tictactoe.h +++ b/src/main/c/Georg/tictactoe.h @@ -17,6 +17,7 @@ char* getWelcomeMessage(); char* getRulesMessage(); struct ticTacToe createTicTacToe(); int handleCommand( char* input ); +struct command* createCommands(); /* commands */ int startMenu(); diff --git a/src/test/c/Georg/test_tictactoe.c b/src/test/c/Georg/test_tictactoe.c index 546dc88..fa1e452 100644 --- a/src/test/c/Georg/test_tictactoe.c +++ b/src/test/c/Georg/test_tictactoe.c @@ -73,4 +73,17 @@ void test_command_startMenu(void){ // assert TEST_ASSERT_EQUAL_INT( expectedState, actualState ); +} + +void test_createCommandlist(void){ + // arrange + struct command* commands = NULL; + + // act + commands = createCommands(); + + size_t arraySize = sizeof(commands) / sizeof(commands[0]); + for (size_t i = 0; i < arraySize; i++) { + TEST_ASSERT_EQUAL_INT( 1, commands[i].fun() ); + } } \ No newline at end of file