コード例 #1
0
 @Test
 public void multipleChoiceCreationGetQuestionMixed() {
   QuestionDao questionDao = new QuestionDaoMock();
   SkillsQuestions multipleChoice = new SkillsQuestionsImpl(questionDao);
   List<Skill> mixedSkills = getSkillsBegginer();
   mixedSkills.addAll(getSkillsItermediate());
   assertTrue("getQuestions didn't work!", multipleChoice.getQuestions(mixedSkills).size() == 4);
 }
コード例 #2
0
 @Test
 public void getQuestionsSimple() {
   QuestionDao questionDao = new QuestionDaoMock();
   SkillsQuestions multipleChoice = new SkillsQuestionsImpl(questionDao);
   assertTrue(
       "getQuestions didn't work!",
       multipleChoice
           .getQuestions("Code1", "BEGINNER")
           .stream()
           .map(a -> a.getSkill().getLevel())
           .allMatch(a -> a.equals(SkillLevel.BEGINNER)));
 }
コード例 #3
0
 @Test
 public void multipleChoiceCreationGetQuestionIntermediate() {
   QuestionDao questionDao = new QuestionDaoMock();
   SkillsQuestions multipleChoice = new SkillsQuestionsImpl(questionDao);
   assertTrue(
       "getQuestions didn't work!",
       multipleChoice
           .getQuestions(this.getSkillsItermediate())
           .stream()
           .map(a -> a.getSkill().getLevel())
           .allMatch(a -> a.equals(SkillLevel.INTERMEDIATE)));
 }
コード例 #4
0
 @Test
 public void multipleChoiceCreationGetQuestionsBegginer() {
   QuestionDao questionDao = new QuestionDaoMock();
   SkillsQuestions multipleChoice = new SkillsQuestionsImpl(questionDao);
   assertTrue(
       "getQuestions didn't work!",
       multipleChoice
           .getQuestions(this.getSkillsBegginer())
           .stream()
           .map(a -> a.getSkill().getLevel())
           .allMatch(a -> a.equals(SkillLevel.BEGINNER)));
 }
コード例 #5
0
 @Test(expected = IllegalArgumentException.class)
 public void multipleChoiceCreationGetQuestionsNull() {
   QuestionDao questionDao = new QuestionDaoMock();
   SkillsQuestions multipleChoice = new SkillsQuestionsImpl(questionDao);
   multipleChoice.getQuestions(null);
 }