@Test public void execute_should_consume_event() { Position position = RandomWar.getInstance().currentWarrior.position; warriorExploreMenuAction.execute(); assertThat(RandomWar.getInstance().currentWarrior.position, not(position)); }
@Test public void execute_should_consume_event() { warriorGameOverAction.execute(); assertThat( RandomWar.getInstance().currentWarrior.position.x, is(WarriorConstant.WARRIOR_INIT_X)); assertThat( RandomWar.getInstance().currentWarrior.position.y, is(WarriorConstant.WARRIOR_INIT_Y)); assertThat( RandomWar.getInstance().currentWarrior.health, is(WarriorConstant.WARRIOR_INIT_HEALTH)); assertThat( RandomWar.getInstance().currentWarrior.score, is(WarriorConstant.WARRIOR_INIT_SCORE)); }
@Before public void setUp() { warrior = new Warrior("id", "name"); RandomWar.getInstance().currentWarrior = warrior; warriorExploreMenuAction = new WarriorExploreMenuAction(eventStore); }
@Before public void setUp() { warrior = new Warrior("id", "name"); warrior.health = 100; warrior.score = 100; warrior.position = new Position(2, 3); RandomWar.getInstance().currentWarrior = warrior; warriorGameOverAction = new WarriorGameOverAction(eventStore); }