示例#1
0
 /** Test of the isAlive method */
 @Test
 public void testIsAlive() {
   assertTrue(monster.isAlive());
   monster.takeDamage(31);
   assertFalse(monster.isAlive());
 }
示例#2
0
 /** Test of the damageMonster method */
 @Test
 public void testDamageMonster() {
   assertTrue(monster.damageMonster() <= (monster.getBaseDamage() + monster.getDamageRange()));
 }
示例#3
0
 /** Test of the takeDamage method */
 @Test
 public void testTakeDamage() {
   monster.takeDamage(10);
   assertEquals(monster.getHealthPoint(), 20);
 }
示例#4
0
 /** Test of the getName method */
 @Test
 public void testGetName() {
   assertEquals(monster.getName(), "Goblin");
 }
示例#5
0
 /** Test of the getDamageRange method */
 @Test
 public void testGetDamageRange() {
   assertEquals(monster.getDamageRange(), 3);
 }
示例#6
0
 /** Test of the getBaseDamage method */
 @Test
 public void testGetBaseDamage() {
   assertEquals(monster.getBaseDamage(), 5);
 }
示例#7
0
 /** Test of the getHealthPoint method */
 @Test
 public void testGetHealthPoint() {
   assertEquals(monster.getHealthPoint(), 30);
 }