@Test public void testGetDamageBonus() { final int damage = boat1.getDamageBonus(); assertThat(damage, greaterThanOrEqualTo(MIN_HIT)); assertThat(damage, lessThanOrEqualTo(MAX_HIT)); assertEquals(MAX_HIT, boat2.getDamageBonus()); }
public int getDamageBonus() { int minModifier = ((BoatProperties) properties).getMinHit(); int maxModifier = ((BoatProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; }
Boat extends AbstractDefensiveItem { public int getDamageBonus() { int minModifier = ((BoatProperties) properties).getMinHit(); int maxModifier = ((BoatProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; } }
Boat extends AbstractDefensiveItem { public int getDamageBonus() { int minModifier = ((BoatProperties) properties).getMinHit(); int maxModifier = ((BoatProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; } Boat(BoatProperties properties, int amount); }
Boat extends AbstractDefensiveItem { public int getDamageBonus() { int minModifier = ((BoatProperties) properties).getMinHit(); int maxModifier = ((BoatProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; } Boat(BoatProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getMinHit(); int getMaxHit(); int getDamageBonus(); @Override boolean canBeStolen(); int getUsageDifficulty(); }
Boat extends AbstractDefensiveItem { public int getDamageBonus() { int minModifier = ((BoatProperties) properties).getMinHit(); int maxModifier = ((BoatProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; } Boat(BoatProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getMinHit(); int getMaxHit(); int getDamageBonus(); @Override boolean canBeStolen(); int getUsageDifficulty();  }