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