@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); }
@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))); }
@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))); }
@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))); }
@Test(expected = IllegalArgumentException.class) public void multipleChoiceCreationGetQuestionsNull() { QuestionDao questionDao = new QuestionDaoMock(); SkillsQuestions multipleChoice = new SkillsQuestionsImpl(questionDao); multipleChoice.getQuestions(null); }