|
@ -32,4 +32,26 @@ class MapTest { |
|
|
assertThat(expectedMiddle).isEqualTo(middle); |
|
|
assertThat(expectedMiddle).isEqualTo(middle); |
|
|
assertThat(expectedBottomRight).isEqualTo(bottomRight); |
|
|
assertThat(expectedBottomRight).isEqualTo(bottomRight); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void Map_getCell_returnsCorrectCells() { |
|
|
|
|
|
// arrange |
|
|
|
|
|
String[] mapTest = { |
|
|
|
|
|
"wew", |
|
|
|
|
|
"w..", |
|
|
|
|
|
"ee." |
|
|
|
|
|
}; |
|
|
|
|
|
Map testMap = new Map(mapTest); |
|
|
|
|
|
Cell expectedTopLeft = testMap.cells[0][0]; |
|
|
|
|
|
Cell expectedMiddle = testMap.cells[1][1]; |
|
|
|
|
|
Cell expectedBottomRight = testMap.cells[2][2]; |
|
|
|
|
|
// act |
|
|
|
|
|
Cell topLeft = testMap.GetCell(new Vector2(0, 0)); |
|
|
|
|
|
Cell middle = testMap.GetCell(new Vector2(1, 1)); |
|
|
|
|
|
Cell bottomRight = testMap.GetCell(new Vector2(2, 2)); |
|
|
|
|
|
// assert |
|
|
|
|
|
assertThat(expectedTopLeft).isEqualTo(topLeft); |
|
|
|
|
|
assertThat(expectedMiddle).isEqualTo(middle); |
|
|
|
|
|
assertThat(expectedBottomRight).isEqualTo(bottomRight); |
|
|
|
|
|
} |
|
|
} |
|
|
} |