Example #1
0
  @Test
  public void shouldStoneIsDestroyedByBullet2() {
    // Given
    givenFl("☼   ☼" + "☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼");

    // When
    diceNew(1);
    hero.recharge();
    hero.act();
    game.tick();

    // Then
    assertE("☼   ☼" + "☼   ☼" + "☼ * ☼" + "☼ ☺ ☼" + "☼   ☼");

    // When
    game.tick();

    // Then
    assertE("☼   ☼" + "☼ * ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼");

    // When
    game.tick();

    // Then
    assertE("☼ x ☼" + "☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼");

    // When
    game.tick();

    // Then
    assertE("☼   ☼" + "☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼");
  }
Example #2
0
  @Test
  public void shouldHeroShoot() {
    // Given
    givenFl("☼   ☼" + "☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼");

    // When
    diceNew();
    hero.recharge();
    hero.act();
    game.tick();
    game.tick();

    // Then
    assertE("☼   ☼" + "☼ * ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼");
  }
Example #3
0
  @Test
  public void shouldBombDestroyedByBullet() {
    // given

    givenFl("☼   ☼" + "☼   ☼" + "☼   ☼" + "☼   ☼" + "☼ ☺ ☼");

    diceNew(-1, 1);
    hero.recharge();
    hero.act();
    game.tick();
    game.tick();
    game.tick();

    assertE("☼ ♣ ☼" + "☼ * ☼" + "☼   ☼" + "☼   ☼" + "☼ ☺ ☼");

    game.tick();

    assertE("☼xxx☼" + "☼xxx☼" + "☼   ☼" + "☼   ☼" + "☼ ☺ ☼");
  }
Example #4
0
  @Test
  public void shouldBulletOutOfTheBoard() {
    // Given
    givenFl("☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼");

    // When
    diceNew();
    hero.recharge();
    hero.act();
    game.tick();

    // Then
    assertE("☼   ☼" + "☼ * ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼");

    game.tick();
    game.tick();

    // Then
    assertE("☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼");
  }
Example #5
0
  @Test
  public void shouldBombDestroyedByBulletNew() {
    // given
    givenFl("☼    ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼" + "☼  ☺ ☼");

    diceNew(0, 2);
    hero.recharge();
    game.tick();
    game.tick();
    hero.act();
    game.tick();
    game.tick();

    // then
    assertE("☼    ☼" + "☼0 ♣ ☼" + "☼    ☼" + "☼  * ☼" + "☼    ☼" + "☼  ☺ ☼");

    game.tick();

    // then
    assertE("☼    ☼" + "☼ xxx☼" + "☼0xxx☼" + "☼ xxx☼" + "☼    ☼" + "☼  ☺ ☼");
  }
Example #6
0
  @Test
  public void shouldNoBulletsAfterFireWithEmptyBulletCharger() {

    newBulletPackForHeroWithGivenBullets(10);
    // Given
    givenFl("☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼");

    // when
    diceNew(-1, -1, -1, -1);

    hero.act();
    game.tick();

    // Then
    assertE("☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼");

    // when
    diceNew(-1, -1, 1, 0);
    game.tick();

    // Then
    assertE("☼   ☼" + "☼ 7 ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼");

    // when
    hero.up();
    game.tick();
    hero.recharge();

    // then
    assertE("☼   ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼" + "☼   ☼");

    // When
    hero.act();
    game.tick();

    // then
    assertE("☼ * ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼" + "☼   ☼");

    // When
    hero.act();
    game.tick();

    // then
    assertE("☼ * ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼" + "☼   ☼");
    hero.act();
    game.tick();

    // then
    assertE(
        "☼ * ☼" + // TODO не присваивается новый BulletCharger
            "☼ ☺ ☼" + "☼   ☼" + "☼   ☼" + "☼   ☼");

    for (int i = 0; i < 8; i++) {
      hero.act();
      game.tick();
    }

    // Given
    assertE(
        "☼   ☼" + // todo по подстетам пуля должна быть (последняя), говорит, что нету
            "☼ ☺ ☼" + "☼   ☼" + "☼   ☼" + "☼   ☼");

    hero.act();
    game.tick();

    // Given
    assertE("☼   ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼" + "☼   ☼");
  }