code-coverage-Emilia #24
@ -16,8 +16,14 @@ public class EquipmentTest {
|
|||||||
private Player defaultWizard(){
|
private Player defaultWizard(){
|
||||||
return new Player("name", wizard);
|
return new Player("name", wizard);
|
||||||
}
|
}
|
||||||
|
private AttributeModifier defaultAttributeModifier(){
|
||||||
|
return new AttributeModifier(4,8,7,1,2,8);
|
||||||
|
}
|
||||||
|
private BodyArmour defaultArmorType(){
|
||||||
|
return new BodyArmour("Body Armour", defaultAttributeModifier());
|
||||||
|
}
|
||||||
private Equipment defaultBodyArmour() {
|
private Equipment defaultBodyArmour() {
|
||||||
AttributeModifier a = new AttributeModifier(4,8,7,1,2,8);
|
AttributeModifier a = defaultAttributeModifier();
|
||||||
BodyArmour b = new BodyArmour("Body Armour", a);
|
BodyArmour b = new BodyArmour("Body Armour", a);
|
||||||
return new Equipment("5", "Thornmail", b, knight, 2);
|
return new Equipment("5", "Thornmail", b, knight, 2);
|
||||||
}
|
}
|
||||||
@ -129,6 +135,13 @@ public class EquipmentTest {
|
|||||||
assertTrue(p.getEquipments().get(defaultMageHat().getSlot()).equals(defaultMageHat()), "Wizard can equip wizard hat");
|
assertTrue(p.getEquipments().get(defaultMageHat().getSlot()).equals(defaultMageHat()), "Wizard can equip wizard hat");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void isNotEqualIfNameIsDifferent() {
|
||||||
|
var e1 = new Equipment("e1", "equipment 1", defaultArmorType(), knight, 1);
|
||||||
|
var e2 = new Equipment("e2", "equipment 2", defaultArmorType(), knight, 1);
|
||||||
|
assertFalse(e1.equals(e2));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void canNotEquipWithWrongJob() {
|
void canNotEquipWithWrongJob() {
|
||||||
var p = defaultWizard();
|
var p = defaultWizard();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user