Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CheckTileFill(const Tile &tile, char color){
- for (auto i = 0; i < Tile::SIZE; ++i){
- for (auto j = 0; j < Tile::SIZE; ++j){
- ASSERT_EQUAL(tile.GetPixel({i, j}), color);
- }
- }
- }
- void TileGetPixel(){
- const char color = '#';
- const Tile tile(color);
- CheckTileFill(tile, color);
- ASSERT_EQUAL(tile.GetPixel({Tile::SIZE, Tile::SIZE}), ' ');
- ASSERT_EQUAL(tile.GetPixel({Tile::SIZE + 1, Tile::SIZE}), ' ');
- ASSERT_EQUAL(tile.GetPixel({Tile::SIZE, Tile::SIZE + 1}), ' ');
- ASSERT_EQUAL(tile.GetPixel({Tile::SIZE + 100, Tile::SIZE + 10}), ' ');
- ASSERT_EQUAL(tile.GetPixel({-1, 1}), ' ');
- ASSERT_EQUAL(tile.GetPixel({1, -1}), ' ');
- ASSERT_EQUAL(tile.GetPixel({-1, -1}), ' ');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement