@Test public void testHumanSetArmor() { Human h = new Human("Steve", 30, -50); // test the setting of armor, even though the init does this for us. h.setArmorPoints(20); assertEquals(20, h.getArmorPoints()); }
@Test public void testHumanArmorEqualToZero() { // Test armor =0 Human h = new Human("Steve", 30, 0); assertEquals(0, h.getArmorPoints()); }
@Test public void testHumanArmorLessThanZero() { // Test armor <0 Human h = new Human("Steve", 30, -50); assertEquals(0, h.getArmorPoints()); }
// !!!! // STRATEGY TESTS START HERE // !!!! @Test public void testHumanInit() { // Test init. Human h = new Human("Bob", 30, 20); assertEquals(20, h.getArmorPoints()); }
/** * Tests the takeHit method of the human, using an alien to do the attacking. * * @throws RecovRateIsNegative EXTRA TEST */ @Test public void testHumanNoArmor() throws RecovRateIsNegative { Human h = new Human("Steve", 30, 0); h.takeHit(10); assertEquals(20, h.getCurrentLifePoints()); }
@Test public void testHumanDefaultAttackStr() { Human h = new Human("Steve", 30, 10); assertEquals(5, h.getAttackDmg()); }
@Test public void testMaxSpeed() { Human h = new Human("H", 30, 30); assertEquals(3, h.getMaxSpeed()); }