|
|
@ -21,4 +21,32 @@ void test_detect_not_valid_tile(void){ |
|
|
|
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 |