Browse Source

6 erster Test + Header

remotes/origin/Simon
Simon Hildebrandt 11 months ago
parent
commit
54a3160ebe
  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