Exemplo n.º 1
0
TEST(MapTest, isBadCellTypeReturnsWhenIndexIsOutOfRange) {
    IMap* map = new Map(IVector2D(10, 10));

    EXPECT_EQ(CellType::BAD_TYPE, map->getCellType(IVector2D(10, 0)));
    EXPECT_EQ(CellType::BAD_TYPE, map->getCellType(IVector2D(0, 10)));
    EXPECT_EQ(CellType::BAD_TYPE, map->getCellType(IVector2D(10, 10)));
}
Exemplo n.º 2
0
TEST(MapTest, canSetCellType) {
    IMap* map = new Map(IVector2D(10, 10));

    map->setCellType(IVector2D(0, 0), CellType::FOREST);

    ASSERT_EQ(CellType::FOREST, map->getCellType(IVector2D(0, 0)));
}
Exemplo n.º 3
0
TEST(MapTest, byDefaultTypeOfFirstCellIsPlains) {
    IMap* map = new Map(IVector2D(10, 10));

    ASSERT_EQ(CellType::PLAINS, map->getCellType(IVector2D(0, 0)));
}