@Test public void testAreBrawling() { WorldObject performer = TestUtils.createIntelligentWorldObject(1, Constants.BRAWL_OPPONENT_ID, 2); WorldObject actionTarget = TestUtils.createIntelligentWorldObject(2, Constants.BRAWL_OPPONENT_ID, 1); assertEquals( true, DefaultGoalObstructedHandler.areBrawling( performer, actionTarget, Actions.NON_LETHAL_MELEE_ATTACK_ACTION)); assertEquals( false, DefaultGoalObstructedHandler.areBrawling( performer, actionTarget, Actions.MELEE_ATTACK_ACTION)); }
@Test public void testAreBrawlingItemEquiped() { WorldObject performer = TestUtils.createIntelligentWorldObject(1, Constants.BRAWL_OPPONENT_ID, 2); WorldObject actionTarget = TestUtils.createIntelligentWorldObject(2, Constants.BRAWL_OPPONENT_ID, 1); performer.setProperty(Constants.LEFT_HAND_EQUIPMENT, Item.IRON_CLAYMORE.generate(1f)); assertEquals( false, DefaultGoalObstructedHandler.areBrawling( performer, actionTarget, Actions.NON_LETHAL_MELEE_ATTACK_ACTION)); }