// Path: chapter6-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/event/DataEventListener.java
// public interface DataEventListener<T> {
//     void onDispatch(T data);
// }
// 
// Path: chapter6-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/event/EventListener.java
// public interface EventListener {
//     void onDispatch();
// }
// 
// Path: chapter5-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/state/StateLoader.java
// public interface StateLoader {
//     int loadInt(String key, int defaultIfNotFound);
//     boolean loadBool(String key, boolean defaultIfNotFound);
// }
// 
// Path: chapter5-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/state/StateSaver.java
// public interface StateSaver {
//     void saveInt(String key, int value);
//     void saveBool(String key, boolean value);
// }


import com.olerass.pfexample.android.geoquiz.domain.event.DataEventListener;
import com.olerass.pfexample.android.geoquiz.domain.event.EventListener;
import com.olerass.pfexample.android.geoquiz.domain.state.StateLoader;
import com.olerass.pfexample.android.geoquiz.domain.state.StateSaver;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
    }

    @Test
    public void constructor_initializesCheaterToFalse_whenCalled() {
        StandardQuestionModel model = new StandardQuestionModel(new Question[]{});

        boolean res = model.isCheater();

        assertEquals(false, res);
    }

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

        StateSaver stateSaver = mock(StateSaver.class);
        model.saveState(stateSaver);

        verify(stateSaver).saveInt("index", 0);
    }

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

// Path: chapter6-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/event/DataEventListener.java
// public interface DataEventListener<T> {
//     void onDispatch(T data);
// }
// 
// Path: chapter6-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/event/EventListener.java
// public interface EventListener {
//     void onDispatch();
// }
// 
// Path: chapter5-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/state/StateLoader.java
// public interface StateLoader {
//     int loadInt(String key, int defaultIfNotFound);
//     boolean loadBool(String key, boolean defaultIfNotFound);
// }
// 
// Path: chapter5-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/state/StateSaver.java
// public interface StateSaver {
//     void saveInt(String key, int value);
//     void saveBool(String key, boolean value);
// }


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

    }

    @Test
    public void constructor_initializesCheaterToFalse_whenCalled() {
        StandardQuestionModel model = new StandardQuestionModel(new Question[]{});

        boolean res = model.isCheater();

        assertEquals(false, res);
    }

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

        StateSaver stateSaver = mock(StateSaver.class);
        model.saveState(stateSaver);

        verify(stateSaver).saveInt("index", 0);
    }

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

        StateLoader stateLoader = mock(StateLoader.class);