Exemplo n.º 1
0
 @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());
 }
Exemplo n.º 2
0
 @Test
 public void testHumanArmorEqualToZero() {
   // Test armor =0
   Human h = new Human("Steve", 30, 0);
   assertEquals(0, h.getArmorPoints());
 }
Exemplo n.º 3
0
 @Test
 public void testHumanArmorLessThanZero() {
   // Test armor <0
   Human h = new Human("Steve", 30, -50);
   assertEquals(0, h.getArmorPoints());
 }
Exemplo n.º 4
0
 // !!!!
 // STRATEGY TESTS START HERE
 // !!!!
 @Test
 public void testHumanInit() {
   // Test init.
   Human h = new Human("Bob", 30, 20);
   assertEquals(20, h.getArmorPoints());
 }
Exemplo n.º 5
0
 /**
  * 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());
 }
Exemplo n.º 6
0
 @Test
 public void testHumanDefaultAttackStr() {
   Human h = new Human("Steve", 30, 10);
   assertEquals(5, h.getAttackDmg());
 }
Exemplo n.º 7
0
 @Test
 public void testMaxSpeed() {
   Human h = new Human("H", 30, 30);
   assertEquals(3, h.getMaxSpeed());
 }