@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tictactoe.h"
@ -21,4 +22,10 @@ struct ticTacToe createTicTacToe() {
struct ticTacToe newGame;
newGame.currentState = 0;
return newGame;
}
int handleState( char* input ){
if( strcmp(input, "start game") == 0 ){
return 1;
@ -8,5 +8,6 @@ struct ticTacToe{
char* getWelcomeMessage();
char* getRulesMessage();
struct ticTacToe createTicTacToe();
int handleState( char* input );
#endif //TICTACTOE_H
@ -49,4 +49,16 @@ void test_initial_state(void){
// assert
TEST_ASSERT_EQUAL_INT( expectedState, newGame.currentState );
void test_userInput(void){
// arrange
int expectedState = 1;
char* input = "start game";
// act
int actualState = handleState( input );
TEST_ASSERT_EQUAL_INT( expectedState, actualState );