Exemplo n.º 1
0
        public void TestQuiz_AnswerMultipleSaSecondCorrect_TwoTotalScore()
        {
            // Arrange
            var quiz = TestQuiz.GetQuiz();
            var multipleSaQuestion = TestQuiz.GetMultipleSAQuestion();

            var answer = new Answer(quiz.QuizSections[1].Id, multipleSaQuestion.Id);

            answer.InteractionResponses.Add(new InteractionResponse(1, "wrong answer"));
            answer.InteractionResponses.Add(new InteractionResponse(2, "answer2"));

            // Act
            multipleSaQuestion.Score(answer);

            // Assert
            Assert.AreEqual(2, answer.TotalScore);
        }
Exemplo n.º 2
0
        public void TestQuiz_AnswerMultipleSaCorrect_ThreeTotalScore()
        {
            // Arrange
            var quiz = TestQuiz.GetQuiz();
            var multipleSaQuestion = TestQuiz.GetMultipleSAQuestion(); // quiz.QuizSections.First().QuestionItems[4];

            var answer = new Answer(quiz.QuizSections[1].Id, multipleSaQuestion.Id);

            answer.InteractionResponses.Add(new InteractionResponse(1, "answer1"));
            answer.InteractionResponses.Add(new InteractionResponse(2, "answer2"));

            // Act
            multipleSaQuestion.Score(answer);

            // Assert
            Assert.AreEqual(3, answer.TotalScore);
        }