I am working on a code with a reduceHealth() method and it seems to work, but when I test it I get the error No Exception Message. I would really appreciate any help. This is in my actor class.
This is in my test class.
1 2 3 4 5 6 7 8 9 | public void reduceHealth( int reduce) { health = health - reduce; if (health <= 0 ) { Island island = (Island) getWorld(); island.remove( this ); } } |
1 2 3 4 5 6 7 | public void testReduceHealth() { bob.reduceHealth( 3 ); assertEquals( 0 , ant.getHealth()); assertEquals( 0 , colony.getObjects(Minnow. class ).size()); } |