monster #20
@@ -18,6 +18,7 @@ public class MonsterTest {
|
|||||||
|
|
||||||
private Player mockPlayer = mock(Player.class);
|
private Player mockPlayer = mock(Player.class);
|
||||||
private World mockWorld = mock(World.class);
|
private World mockWorld = mock(World.class);
|
||||||
|
private Tile mockTile = mock(Tile.class);
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void reset() {
|
void reset() {
|
||||||
@@ -192,4 +193,13 @@ public class MonsterTest {
|
|||||||
assertThat(true, equalTo(defaultShade.performAttack(Attacks.CHILL, mockPlayer)));
|
assertThat(true, equalTo(defaultShade.performAttack(Attacks.CHILL, mockPlayer)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void troll_wont_move_to_tile_with_wrong_biome() {
|
||||||
|
Position destination = new Position(1, 3);
|
||||||
|
when(mockTile.getBiome()).thenReturn(Biomes.COAST);
|
||||||
|
when(mockWorld.getTileAtPosition(destination)).thenReturn(mockTile);
|
||||||
|
|
||||||
|
assertThat(false, equalTo(defaultTroll.moveTo(destination, mockWorld)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user