Пример #1
0
  /** Create a user, create a state and make him answer a few questions. */
  @Before
  public void setup() {

    // setup user
    expectedUser = new User("xuser");
    expectedUser.setId(1234);

    // setup level
    expectedLevel = QuestionLevel.LEVEL_1;

    // setup question
    expectedQuestion = new Question();
    expectedQuestion.setAnswer("xanswer");
    expectedQuestion.setType(QuestionType.TEXT);
    expectedQuestion.setCategory(QuestionCategory.SHAPES);
    List<String> choices = new ArrayList();
    choices.add("apple");
    choices.add("orange");
    choices.add("banana");
    choices.add("cherry");
    expectedQuestion.setChoices(choices);
    expectedQuestion.setLevel(expectedLevel);
    expectedQuestion.setQuestion("xquestion");
    expectedQuestion.setExplaination("xplanation");

    // set current question and level for user
    expectedUser.setCurrentQuestion(expectedQuestion);
    expectedUser.endState();
    fileUserManager.addUser(expectedUser);
  }