@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("☼ ☼" + "☼ ☼" + "☼ ☼" + "☼ ☺ ☼" + "☼ ☼"); }
@Test public void shouldHeroShootAfterRecharge() { // todo make it independent from starting conditions // Given givenFl("☼ ☼" + "☼ ☺ ☼" + "☼ ☼" + "☼ ☼" + "☼ ☼"); // when diceNew(-1, -1, 0, 0); game.tick(); // Given assertE("☼ ☼" + "☼7☺ ☼" + "☼ ☼" + "☼ ☼" + "☼ ☼"); // when hero.act(); game.tick(); // Given assertE( "☼ * ☼" + // у него в начале теста есть одна пуля, выплюнем ее "☼7☺ ☼" + "☼ ☼" + "☼ ☼" + "☼ ☼"); // when hero.act(); game.tick(); // Given assertE("☼ ☼" + "☼7☺ ☼" + "☼ ☼" + "☼ ☼" + "☼ ☼"); hero.left(); game.tick(); // Given assertE("☼ ☼" + "☼☺ ☼" + "☼ ☼" + "☼ ☼" + "☼ ☼"); // When hero.act(); game.tick(); // Then assertE("☼* ☼" + "☼☺ ☼" + "☼ ☼" + "☼ ☼" + "☼ ☼"); }
@Test public void shouldHeroShoot() { // Given givenFl("☼ ☼" + "☼ ☼" + "☼ ☼" + "☼ ☺ ☼" + "☼ ☼"); // When diceNew(); hero.recharge(); hero.act(); game.tick(); game.tick(); // Then assertE("☼ ☼" + "☼ * ☼" + "☼ ☼" + "☼ ☺ ☼" + "☼ ☼"); }
@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☼" + "☼ ☼" + "☼ ☼" + "☼ ☺ ☼"); }
@Test public void shouldBulletOutOfTheBoard() { // Given givenFl("☼ ☼" + "☼ ☼" + "☼ ☺ ☼" + "☼ ☼" + "☼ ☼"); // When diceNew(); hero.recharge(); hero.act(); game.tick(); // Then assertE("☼ ☼" + "☼ * ☼" + "☼ ☺ ☼" + "☼ ☼" + "☼ ☼"); game.tick(); game.tick(); // Then assertE("☼ ☼" + "☼ ☼" + "☼ ☺ ☼" + "☼ ☼" + "☼ ☼"); }
@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☼" + "☼ ☼" + "☼ ☺ ☼"); }
@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("☼ ☼" + "☼ ☺ ☼" + "☼ ☼" + "☼ ☼" + "☼ ☼"); }