예제 #1
0
TEST(MapTest, isBadIDReturnsWhenIndexIsOutOfRange) {
    IMap* map = new Map(IVector2D(10, 10));

    EXPECT_EQ(-1, map->getIndividualID(IVector2D(10, 0)));
    EXPECT_EQ(-1, map->getIndividualID(IVector2D(0, 10)));
    EXPECT_EQ(-1, map->getIndividualID(IVector2D(10, 10)));
}
예제 #2
0
TEST(MapTest, canSetIndividualID) {
    IMap* map = new Map(IVector2D(10, 10));

    map->setIndividualID(IVector2D(0, 0), 1);

    ASSERT_EQ(1, map->getIndividualID(IVector2D(0, 0)));
}
예제 #3
0
TEST(MapTest, byDefaultFirstCellHasNoIndividuals) {
    IMap* map = new Map(IVector2D(10, 10));

    ASSERT_EQ(0, map->getIndividualID(IVector2D(0, 0)));
}