/** * This method asserts that the passed goblin object has the name as expectedName, size as * expectedSize and visibility as expectedVisibility. * * @param goblin a goblin object whose state is to be verified against other parameters * @param expectedName expectedName of the goblin * @param expectedSize expected size of the goblin * @param expectedVisibilty exepcted visibility of the goblin */ private void verifyGoblin( Goblin goblin, String expectedName, Size expectedSize, Visibility expectedVisibilty) { assertEquals("Goblin's name must be same as expectedName", expectedName, goblin.toString()); assertEquals("Goblin's size must be same as expectedSize", expectedSize, goblin.getSize()); assertEquals( "Goblin's visibility must be same as expectedVisibility", expectedVisibilty, goblin.getVisibility()); }
public static void main(String[] args) { Wizard wizard = new Wizard(); Goblin goblin = new Goblin(); goblin.printStatus(); wizard.castSpell(new ShrinkSpell(), goblin); goblin.printStatus(); wizard.castSpell(new InvisibilitySpell(), goblin); goblin.printStatus(); wizard.undoLastSpell(); goblin.printStatus(); }