Ad
  • Default User Avatar

    private void Test(String description, PokerHand.Result expected, String playerHand, String opponentHand)
    {
    PokerHand player = new PokerHand(playerHand);
    PokerHand opponent = new PokerHand(opponentHand);
    -->PokerHand.Result r = player.compareWith(opponent);

        assertEquals(description + ":", expected.toString(), player.compareWith(opponent).toString());
    }
    

    In your example test class, and also in your second test the variable r is never used, causing the method compareWith() to be called twice.

    You could either remove the line with the --> next to it or change:

    assertEquals(description + ":", expected.toString(), player.compareWith(opponent).toString());

    to

    assertEquals(description + ":", expected.toString(), r.toString());

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution