コード例 #1
0
        public void SetUp()
        {
            IQuiz <bool, bool> quiz = Substitute.For <Quiz <bool, bool> >();

            testObject = quiz;
            testObject.IsCorrect(true).Returns(true);
            testObject.IsCorrect(false).Returns(false);
        }
コード例 #2
0
        public void Answer_Quiz_Return_Active_Quiz_IsCorrect(bool answer)
        {
            IQuiz newQuiz = Substitute.For <IQuiz>();

            newQuiz.IsCorrect(true).Returns(true);
            newQuiz.IsCorrect(false).Returns(false);
            testObject.AddQuiz(newQuiz);
            testObject.SelectQuiz(newQuiz);
            Assert.That(testObject.AnswerQuiz(true), Is.EqualTo(true));
        }
コード例 #3
0
 private void PopulateSystem(int times)
 {
     for (int i = 0; i < times; i++)
     {
         IQuiz newQuiz = Substitute.For <IQuiz>();
         newQuiz.IsCorrect(true).Returns(true);
         newQuiz.IsCorrect(false).Returns(false);
         testObject.AddQuiz(newQuiz);
     }
 }
コード例 #4
0
 public void Is_Correct_Return_True_On_Correct_Answer()
 {
     Assert.That(testObject.IsCorrect(true), Is.True);
 }