示例#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());
 }
示例#2
0
 @Test
 public void testHumanArmorEqualToZero() {
   // Test armor =0
   Human h = new Human("Steve", 30, 0);
   assertEquals(0, h.getArmorPoints());
 }
示例#3
0
 @Test
 public void testHumanArmorLessThanZero() {
   // Test armor <0
   Human h = new Human("Steve", 30, -50);
   assertEquals(0, h.getArmorPoints());
 }
示例#4
0
 // !!!!
 // STRATEGY TESTS START HERE
 // !!!!
 @Test
 public void testHumanInit() {
   // Test init.
   Human h = new Human("Bob", 30, 20);
   assertEquals(20, h.getArmorPoints());
 }