From 40ca77c8f6beb3c6107cf0ec89f86b4871839bbb Mon Sep 17 00:00:00 2001 From: KaffeeMaus Date: Fri, 26 Jan 2024 12:09:22 +0100 Subject: [PATCH] add another vertical player won test --- src/test/c/Georg/test_tictactoe.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/test/c/Georg/test_tictactoe.c b/src/test/c/Georg/test_tictactoe.c index 851eeb7..6c2bcb5 100644 --- a/src/test/c/Georg/test_tictactoe.c +++ b/src/test/c/Georg/test_tictactoe.c @@ -320,6 +320,37 @@ void test_negativ_checkOnWin_vertically2(void){ bool result2 = playerHasWon( board2 ); 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 TEST_ASSERT_EQUAL_INT( 0, result ); TEST_ASSERT_EQUAL_INT( 0, result2 );