### Question:
AiStrategy extends Strategy { @Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) { if (currentHealth < 10) { return new Move(highestCard(availableMana, availableCards), Action.HEALING); } else { return new Move(bestCard(availableMana, availableCards), Action.DAMAGE); } }  @Override Move nextMove(int availableMana, int currentHealth, List<Card> availableCards);  }### Answer:
@Test public void shouldMaximizeDamageOutputInCurrentTurn() { assertThat(strategy.nextMove(withMana(8), andHealth(30), fromCards(7, 6, 4, 3, 2)), either(is(isAttackingWithCard(2))).or(is(isAttackingWithCard(6)))); }
@Test public void shouldPlayAsManyCardsAsPossibleForMaximumDamage() { assertThat(strategy.nextMove(withMana(3), andHealth(30), fromCards(1, 2, 3)), either(is(isAttackingWithCard(1))).or(is(isAttackingWithCard(2)))); }
@Test public void shouldPickHighestAffordableCardWhenNoComboIsPossible() { assertThat(strategy.nextMove(withMana(2), andHealth(30), fromCards(1, 2, 3)), isAttackingWithCard(2)); }
@Test public void shouldUseHealingUntilHealthIsAtLeast10() { assertThat(strategy.nextMove(withMana(3), andHealth(8), fromCards(1, 1, 1)), isHealingWithCard(1)); assertThat(strategy.nextMove(withMana(2), andHealth(9), fromCards(1, 1)), isHealingWithCard(1)); assertThat(strategy.nextMove(withMana(1), andHealth(10), fromCards(1)), isAttackingWithCard(1)); }
@Test public void shouldReturnNoCardIfInsufficientManaForAnyHandCard() { assertThat(strategy.nextMove(withMana(1), andHealth(30), fromCards(2, 3, 8)), is(noMove())); }