Browse Source

Test detect valid tile

remotes/origin/David
David Moeller 11 months ago
parent
commit
6ce31b79c6
  1. 28
      test/Minesweeper/test_is_Valid_tile.c

28
test/Minesweeper/test_is_Valid_tile.c

@ -21,4 +21,32 @@ void test_detect_not_valid_tile(void){
TEST_ASSERT_EQUAL_INT(-1, result);//not valid tile TEST_ASSERT_EQUAL_INT(-1, result);//not valid tile
} }
void test_detect_valid_tile_right(void){
/* arrange */
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 5;
int result;
/* act */
result = is_Valid_tile(&board, tile, direction);
/* assert */
TEST_ASSERT_EQUAL_INT(1, result);//not valid tile
}
void test_detect_valid_tile_down(void){
/* arrange */
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 4;
int result;
/* act */
result = is_Valid_tile(&board, tile, direction);
/* assert */
TEST_ASSERT_EQUAL_INT(0 + board.width, result);//not valid tile
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save