Browse Source

6 erster Test + Header

main^2
Simon Hildebrandt 11 months ago
committed by Peter Wiebe
parent
commit
4e4eb7150c
  1. 7
      src/main/c/TicTacToe.h
  2. 29
      src/test/c/test_TicTacToe.c

7
src/main/c/TicTacToe.h

@ -0,0 +1,7 @@
#ifndef TICTACTOE_H
#define TICTACTOE_H
int Winner(char board[3][3]);
#endif

29
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);
}
Loading…
Cancel
Save