diff --git a/src/main/c/TicTacToe.h b/src/main/c/TicTacToe.h new file mode 100644 index 0000000..1e04a7d --- /dev/null +++ b/src/main/c/TicTacToe.h @@ -0,0 +1,7 @@ +#ifndef TICTACTOE_H +#define TICTACTOE_H + +int Winner(char board[3][3]); + +#endif + diff --git a/src/test/c/test_TicTacToe.c b/src/test/c/test_TicTacToe.c new file mode 100644 index 0000000..b1c8b25 --- /dev/null +++ b/src/test/c/test_TicTacToe.c @@ -0,0 +1,29 @@ + +#include "unity.h" + +#include "TicTacToe.h" + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test_TicTacToe_Winner_X_line_1(void) +{ + /* arrange */ + int expected = 1; + int actual; + char board[3][3] = { + {'X', 'X', 'X'}, + {'O', 'O', '_'}, + {'O', '_', '_'} + }; + /* act */ + actual = Winner(board); + + /* assert */ + TEST_ASSERT_EQUAL_INT(expected, actual); +} \ No newline at end of file