コード例 #1
0
        public void GetNumberOfAnsweredTest()
        {
            VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值
            int expected = 0;                                               // TODO: 初始化為適當值
            int actual;

            target.Initialize();
            actual = target.NumberOfAnswered;
            Assert.AreEqual(expected, actual);
            target._isFillQuestion = false;
            target.GetNewFillQuestion();
            target.CheckAnswer("HAHA", 0);
            actual = target.NumberOfAnswered;
            Assert.AreEqual(1, actual);
            target.CreateNewSelectionQuestion();
            target.CheckAnswer("NONO", 0);
            actual = target.NumberOfAnswered;
            Assert.AreEqual(2, actual);
        }
コード例 #2
0
        public void CheckAnswerTest()
        {
            VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值
            string actual;

            target.Initialize();
            target._isFillQuestion = true;
            target.GetNewFillQuestion();
            actual = target.CheckAnswer(target._fillQuestion.Answer, 0);
            Assert.AreEqual("Correct!!", actual);
            target.GetNewFillQuestion();
            actual = target.CheckAnswer("AlwaysFail", 0);
            Assert.AreEqual("It should be " + target._fillQuestion.Answer, actual);
            target._isFillQuestion = false;
            target.CreateNewSelectionQuestion();
            actual = target.CheckAnswer("", target._selectionAnswer);
            Assert.AreEqual("Correct!!", actual);
            target.CreateNewSelectionQuestion();
            actual = target.CheckAnswer("AlwaysFail", 0);
            Assert.AreEqual("It should be " + "(" + target._selectionAnswer.ToString() + ") " + target._selectionQuestion.Answer, actual);
        }
コード例 #3
0
        public void InitializeTest()
        {
            VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值

            target.Initialize();
            target.CreateNewSelectionQuestion();
            target._isFillQuestion = false;
            target.CheckAnswer("HAHA", 0);
            target.Initialize();
            Assert.AreEqual(0, target._numberOfAnswer);
            Assert.AreEqual(0, target._correct);
            Assert.AreEqual(true, target._isFillQuestion);
        }
コード例 #4
0
 public void CheckAnswerTest()
 {
     VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值
     string actual;
     target.Initialize();
     target._isFillQuestion = true;
     target.GetNewFillQuestion();
     actual = target.CheckAnswer(target._fillQuestion.Answer,0);
     Assert.AreEqual("Correct!!", actual);
     target.GetNewFillQuestion();
     actual = target.CheckAnswer("AlwaysFail",0);
     Assert.AreEqual("It should be " + target._fillQuestion.Answer, actual);
     target._isFillQuestion = false;
     target.CreateNewSelectionQuestion();
     actual = target.CheckAnswer("",target._selectionAnswer);
     Assert.AreEqual("Correct!!", actual);
     target.CreateNewSelectionQuestion();
     actual = target.CheckAnswer("AlwaysFail",0);
     Assert.AreEqual("It should be " + "(" + target._selectionAnswer.ToString() + ") " + target._selectionQuestion.Answer, actual);
 }
コード例 #5
0
 public void InitializeTest()
 {
     VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值
     target.Initialize();
     target.CreateNewSelectionQuestion();
     target._isFillQuestion = false;
     target.CheckAnswer("HAHA",0);
     target.Initialize();
     Assert.AreEqual(0, target._numberOfAnswer);
     Assert.AreEqual(0, target._correct);
     Assert.AreEqual(true, target._isFillQuestion);
 }
コード例 #6
0
 public void GetNumberOfAnsweredTest()
 {
     VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值
     int expected = 0; // TODO: 初始化為適當值
     int actual;
     target.Initialize();
     actual = target.NumberOfAnswered;
     Assert.AreEqual(expected, actual);
     target._isFillQuestion = false;
     target.GetNewFillQuestion();
     target.CheckAnswer("HAHA",0);
     actual = target.NumberOfAnswered;
     Assert.AreEqual(1, actual);
     target.CreateNewSelectionQuestion();
     target.CheckAnswer("NONO",0);
     actual = target.NumberOfAnswered;
     Assert.AreEqual(2, actual);
 }