use of com.google.samples.apps.topeka.model.quiz.Quiz in project android-topeka by googlesamples.
the class CategoryAndroidTest method getQuizzes.
private static List<Quiz> getQuizzes() {
List<Quiz> quizzes = new ArrayList<>();
quizzes.add(new TrueFalseQuiz("huh?", true, false));
quizzes.add(new FillBlankQuiz("so?", "yeah", "go", "stop", false));
return quizzes;
}
use of com.google.samples.apps.topeka.model.quiz.Quiz in project android-topeka by googlesamples.
the class BaseQuizActivityTest method testCategory.
/**
* End to end test for the given category.
*/
protected void testCategory() {
final Category category = getCurrentCategory();
onView(withId(R.id.fab_quiz)).perform(click());
for (Quiz quiz : category.getQuizzes()) {
SolveQuizUtil.solveQuiz(quiz);
onView(allOf(withId(R.id.submitAnswer), isDisplayed())).check(matches(isDisplayed())).perform(click());
}
}
use of com.google.samples.apps.topeka.model.quiz.Quiz in project android-topeka by googlesamples.
the class QuizAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final Quiz quiz = getItem(position);
if (convertView instanceof AbsQuizView) {
if (((AbsQuizView) convertView).getQuiz().equals(quiz)) {
return convertView;
}
}
convertView = getViewInternal(quiz);
return convertView;
}
Aggregations