public void ShouldReturnTheSameNumber()
        {
            TestQuestionFactory factory = new TestQuestionFactory();
            Question = new Model.Question();
            Question.PredefinedAnswers = new List<PredefinedAnswer>();
            pre1 = new PredefinedAnswer();
            pre2 = new PredefinedAnswer();
            pre1.Id = 1;
            pre1.Text = "Ja";
            pre2.Id = 2;
            pre2.Text = "Nee";
            Question.PredefinedAnswers.Add(pre1);
            Question.PredefinedAnswers.Add(pre2);

            answer1 = new UserAnswer();
            answer2 = new UserAnswer();
            answer3 = new UserAnswer();
            answer1.PredefinedAnswer_Id = pre1.Id;
            answer2.PredefinedAnswer_Id = pre2.Id;
            answer3.PredefinedAnswer_Id = pre1.Id;

            foreach (PredefinedAnswer item in Question.PredefinedAnswers)
            {
                Question.PredefinedAnswerCount++;
            }

            Assert.AreEqual(Question.PredefinedAnswerCount, 3);
        }
示例#2
0
        public void ShouldReturnTheSameNumber()
        {
            Question = new Model.Question();
            Question.PredefinedAnswers = new List<PredefinedAnswer>();
            answer1 = new PredefinedAnswer();
            answer2 = new PredefinedAnswer();
            answer3 = new PredefinedAnswer();
            answer1.Id = 1;
            answer1.Text = "Ja";
            answer2.Id = 2;
            answer2.Text = "Ja";
            answer3.Id = 3;
            answer3.Text = "Nee";
            Question.PredefinedAnswers.Add(answer1);
            Question.PredefinedAnswers.Add(answer2);
            Question.PredefinedAnswers.Add(answer3);

            foreach (PredefinedAnswer item in Question.PredefinedAnswers)
            {
                Question.PredefinedAnswerCount++;
            }

            Assert.AreEqual(Question.PredefinedAnswerCount, 3);
        }