Ejemplo n.º 1
0
  /** Test of playCard method, of class Hero. */
  @Test
  public void testPlayCard() {
    System.out.println("playCard");
    Player testPlayer = new Player(0, "testName", 0, 0, 0, 0, 0);
    Match testMatch = new Match(testPlayer);
    Deck testDeck = new Deck();
    Hero testHero = new Hero(testMatch, testPlayer, testDeck);
    Card testCard = new HeroCard("testname", "testFilename", "testDescription", 1, 1, 1, 1, 1) {};

    boolean result = testHero.playCard(testCard);
    assertTrue(result);
    assertNotNull(testHero.getCardPlayed());

    MinionCard testMinionCard =
        new MinionCard("testname", "testFilename", "testDescription", 1, 1, 1) {};
    Minion testMinion = new Minion(testMinionCard);
    ArrayList minions = new ArrayList();
    minions.add(testMinion);
    minions.add(testMinion);
    testHero.setMinions(minions);

    result = testHero.playCard(testCard);
    assertTrue(result);
    assertNotNull(testHero.getCardPlayed());
  }
Ejemplo n.º 2
0
  /** Test of setCardPlayed method, of class Hero. */
  @Test
  public void testSetCardPlayed() {
    System.out.println("setCardPlayed");
    Player testPlayer = new Player(0, "testName", 0, 0, 0, 0, 0);
    Match testMatch = new Match(testPlayer);
    Deck testDeck = new Deck();
    Hero testHero = new Hero(testMatch, testPlayer, testDeck);

    testHero.setCardPlayed(
        new HeroCard("testname", "testFilename", "testDescription", 1, 1, 1, 1, 1) {});
    Card result = testHero.getCardPlayed();
    assertEquals(testHero.getCardPlayed(), result);
  }