package com.adaptionsoft.games.uglytrivia;

import org.junit.Ignore;
import org.junit.Test;

import static org.mockito.Mockito.*;

public class GameCorrectAnswerTest {

    @Test
    public void correctAnswerShouldGetACoin() {
        Player player = mock(Player.class);
        Game game = createGameWithSinglePlayer(player);

        game.correctAnswer();

        verify(player, times(1)).answeredCorrect();
    }

    private Game createGameWithSinglePlayer(Player player) {
        Players players = new Players();
        players.add(player);
        return new Game(players, null);
    }

    @Test
    public void correctAnswerShouldEndTurn() {
        Players players = mock(Players.class);
        Game game = new Game(players, null);

        game.correctAnswer();

        verify(players).changeCurrentPlayer();
    }
}
@@ -37,16 +37,45 @@
 rivia;%0A%0A
+import org.hamcrest.core.Is;%0A
 import o
@@ -115,16 +115,98 @@
 .Test;%0A%0A
+import static org.hamcrest.core.Is.is;%0Aimport static org.junit.Assert.assertThat;%0A
 import s
@@ -933,10 +933,556 @@
 );%0A    %7D
+%0A%0A    @Test%0A    @Ignore(%22known defect in code%22)%0A    public void correctAnswerShouldGetPlayerOutOfPenaltyBoxIfLucky() %7B%0A        Player playerInPenaltyBox = mock(Player.class);%0A        when(playerInPenaltyBox.isInPenaltyBox()).thenReturn(true);%0A        when(playerInPenaltyBox.isGettingOutOfPenaltyBox()).thenReturn(true);%0A        Game game = createGameWithSinglePlayer(playerInPenaltyBox);%0A%0A        game.correctAnswer();%0A%0A        // verify(playerInPenaltyBox).exitPenaltyBox();%0A    %7D%0A%0A    // right answer with enough previous couns should end game
 %0A%7D

Test that player is can leave penalty box when lucky, but ignored because of defect