// Path: chapter6-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/event/EventListener.java
// public interface EventListener {
//     void onDispatch();
// }


import com.olerass.pfexample.android.geoquiz.domain.event.EventListener;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
    @Test
    public void gotoNextQuestion_setsCurrentQuestionToTheOneFollowingTheCurrentQuestion_whenThereIsOneFollowing() {
        StandardQuestionModel model = new StandardQuestionModel(new Question[] {
                new Question("question1", true),
                new Question("question2", false)
        });

        model.gotoNextQuestion();

        assertEquals("question2", model.getQuestionText());
        assertEquals(true, model.isCorrectAnswer(false));
    }

    @Test
    public void gotoNextQuestion_setsCurrentQuestionToFirstQuestion_whenCurrentQuestionIsLastOne() {
        StandardQuestionModel model = new StandardQuestionModel(new Question[] {
                new Question("question1", true)
        });

        model.gotoNextQuestion();

        assertEquals("question1", model.getQuestionText());
        assertEquals(true, model.isCorrectAnswer(true));
    }

    @Test
    public void gotoNextQuestion_notifiesListenerThatQuestionTextHasChanged_whenCalled() {
        StandardQuestionModel model = new StandardQuestionModel(new Question[] {
                new Question("question1", true)
        });
// Path: chapter6-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/event/EventListener.java
// public interface EventListener {
//     void onDispatch();
// }


// Path: chapter2-geoquiz-challenges/app/src/test/java/com/olerass/pfexample/android/geoquiz/domain/question/StandardQuestionModelTest.java
import com.olerass.pfexample.android.geoquiz.domain.event.EventListener;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

    @Test
    public void gotoNextQuestion_setsCurrentQuestionToTheOneFollowingTheCurrentQuestion_whenThereIsOneFollowing() {
        StandardQuestionModel model = new StandardQuestionModel(new Question[] {
                new Question("question1", true),
                new Question("question2", false)
        });

        model.gotoNextQuestion();

        assertEquals("question2", model.getQuestionText());
        assertEquals(true, model.isCorrectAnswer(false));
    }

    @Test
    public void gotoNextQuestion_setsCurrentQuestionToFirstQuestion_whenCurrentQuestionIsLastOne() {
        StandardQuestionModel model = new StandardQuestionModel(new Question[] {
                new Question("question1", true)
        });

        model.gotoNextQuestion();

        assertEquals("question1", model.getQuestionText());
        assertEquals(true, model.isCorrectAnswer(true));
    }

    @Test
    public void gotoNextQuestion_notifiesListenerThatQuestionTextHasChanged_whenCalled() {
        StandardQuestionModel model = new StandardQuestionModel(new Question[] {
                new Question("question1", true)
        });
        EventListener textChangedListener = mock(EventListener.class);