Browse Source

add another vertical player won test

remotes/origin/georg
KaffeeMaus 11 months ago
parent
commit
40ca77c8f6
  1. 31
      src/test/c/Georg/test_tictactoe.c

31
src/test/c/Georg/test_tictactoe.c

@ -320,6 +320,37 @@ void test_negativ_checkOnWin_vertically2(void){
bool result2 = playerHasWon( board2 ); bool result2 = playerHasWon( board2 );
bool result3 = playerHasWon( board3 ); bool result3 = playerHasWon( board3 );
// assert
TEST_ASSERT_EQUAL_INT( 0, result );
TEST_ASSERT_EQUAL_INT( 0, result2 );
TEST_ASSERT_EQUAL_INT( 0, result3 );
}
void test_negativ_checkOnWin_vertically3(void){
// arrange
bool board1[3][3]={
{0,0,1},
{0,0,0},
{0,0,0}
};
bool board2[3][3]={
{0,0,0},
{0,0,1},
{0,0,0}
};
bool board3[3][3]={
{0,0,0},
{0,0,0},
{0,0,1}
};
// act
bool result = playerHasWon( board1 );
bool result2 = playerHasWon( board2 );
bool result3 = playerHasWon( board3 );
// assert // assert
TEST_ASSERT_EQUAL_INT( 0, result ); TEST_ASSERT_EQUAL_INT( 0, result );
TEST_ASSERT_EQUAL_INT( 0, result2 ); TEST_ASSERT_EQUAL_INT( 0, result2 );

Loading…
Cancel
Save