Player test for 100% coverage #23
@ -42,7 +42,6 @@ public class World {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
for (int i = 0; i < map.length; i++) {
|
for (int i = 0; i < map.length; i++) {
|
||||||
System.out.println();
|
|
||||||
for (int j = 0; j < map[i].length; j++) {
|
for (int j = 0; j < map[i].length; j++) {
|
||||||
System.out.print(map[i][j]);
|
System.out.print(map[i][j]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public class DigActionTest {
|
|||||||
var player = mock(Player.class);
|
var player = mock(Player.class);
|
||||||
when(player.getJob()).thenReturn(mockMiner);
|
when(player.getJob()).thenReturn(mockMiner);
|
||||||
var biome = mock(Biome.class);
|
var biome = mock(Biome.class);
|
||||||
var action = new DigAction(Biome.COAST);
|
var action = new DigAction(biome);
|
||||||
action.execute(player);
|
action.execute(player);
|
||||||
verify(mockMiner, times(1)).dig(biome);
|
verify(mockMiner, times(1)).dig(biome);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,6 +40,28 @@ public class EquipmentTest {
|
|||||||
assertEquals("Thornmail", e.getName(), "Equipment name should have been set");
|
assertEquals("Thornmail", e.getName(), "Equipment name should have been set");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void returnsUnmodifiedMagicStrengthIfNoEquipment(){
|
||||||
|
var w = new Player("name");
|
||||||
|
assertEquals(0, w.getMagicStrength());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void returnsUnmodifiedDefenceIfNoEquipment(){
|
||||||
|
var w = new Player("name");
|
||||||
|
assertEquals(0, w.getDefence());
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void returnsUnmodifiedStrengthIfNoEquipment(){
|
||||||
|
var w = new Player("name");
|
||||||
|
assertEquals(0, w.getStrength());
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void returnsUnmodifiedMagicDefenceIfNoEquipment(){
|
||||||
|
var w = new Player("name");
|
||||||
|
assertEquals(0, w.getMagicDefence());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void setEquipmentWeightOnCreation() {
|
void setEquipmentWeightOnCreation() {
|
||||||
var e = defaultBodyArmour();
|
var e = defaultBodyArmour();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user