예제 #1
0
  @Test
  public void shouldStoneDestroyHero2() {
    // given
    givenFl("☼    ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼" + "☼  ☺ ☼" + "☼    ☼");

    diceNew(2);
    game.tick();
    game.tick();
    game.tick();
    game.tick();

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

    hero.up();
    game.tick();

    // then
    assertE("☼    ☼" + "☼    ☼" + "☼  0 ☼" + "☼  ☺ ☼" + "☼    ☼" + "☼    ☼");
    hero.up();
    game.tick();

    // then
    assertE("☼    ☼" + "☼    ☼" + "☼  + ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼");
  }
예제 #2
0
  @Test
  public void shouldNewBulletPackAfterHeroGetOldBulletPack() {
    // given
    givenFl("☼    ☼" + "☼ ☺  ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼");

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

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

    hero.left();
    game.tick();

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

    hero.up();
    game.tick();
    diceNew(-1, -1, 3, 0);
    game.tick();

    // then
    assertE("☼☺   ☼" + "☼   7☼" + "☼    ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼");
  }
예제 #3
0
  // я могу двигаться
  @Test
  public void shouldFieldICanMove() {
    // given
    givenFl("☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼");
    // when
    diceNew(); // выключаем генерацию каменей и мин
    hero.up();
    game.tick();

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

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

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

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

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

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

    // Then
    assertE("☼   ☼" + "☼   ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼");
  }
예제 #4
0
  @Test
  public void shouldHeroPickUpBulletPack() {
    // given
    givenFl("☼    ☼" + "☼    ☼" + "☼ ☺  ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼");

    diceNew(-1, -1, 1, 1);
    game.tick();
    game.tick();
    game.tick();
    game.tick();

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

    hero.up();
    game.tick();

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

    hero.up();
    game.tick();

    assertE("☼ ☺  ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼" + "☼    ☼");
  }
예제 #5
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("☼   ☼" + "☼ ☺ ☼" + "☼   ☼" + "☼   ☼" + "☼   ☼");
  }