Пример #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);
 }