Пример #1
0
        public void TestQuiz_AnswerSaCorrect_OneTotalScore()
        {
            // Arrange
            var quiz       = TestQuiz.GetQuiz();
            var saQuestion = TestQuiz.GetSAQuestion();

            var answer = new Answer(quiz.QuizSections.First().Id, saQuestion.Id);

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

            // Act
            saQuestion.Score(answer);

            // Assert
            Assert.AreEqual(1, answer.TotalScore);
        }
Пример #2
0
        public void TestQuiz_AnswerSaIncorrectNoAnswer_ZeroTotalScore()
        {
            // Arrange
            var quiz       = TestQuiz.GetQuiz();
            var saQuestion = TestQuiz.GetSAQuestion();

            var answer = new Answer(quiz.QuizSections.First().Id, saQuestion.Id);

            answer.InteractionResponses.Add(new InteractionResponse(1, string.Empty));

            // Act
            saQuestion.Score(answer);

            // Assert
            Assert.AreEqual(0, answer.TotalScore);
            Assert.IsTrue(answer.FlaggedForManualCorrection);
        }