コード例 #1
0
  @Test
  public void execute_should_consume_event() {
    Position position = RandomWar.getInstance().currentWarrior.position;

    warriorExploreMenuAction.execute();

    assertThat(RandomWar.getInstance().currentWarrior.position, not(position));
  }
コード例 #2
0
  @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));
  }
コード例 #3
0
  @Before
  public void setUp() {
    warrior = new Warrior("id", "name");
    RandomWar.getInstance().currentWarrior = warrior;

    warriorExploreMenuAction = new WarriorExploreMenuAction(eventStore);
  }
コード例 #4
0
  @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);
  }