monster #20
@ -18,6 +18,7 @@ public class MonsterTest {
|
||||
|
||||
private Player mockPlayer = mock(Player.class);
|
||||
private World mockWorld = mock(World.class);
|
||||
private Tile mockTile = mock(Tile.class);
|
||||
|
||||
@BeforeEach
|
||||
void reset() {
|
||||
@ -192,4 +193,13 @@ public class MonsterTest {
|
||||
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)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user