Пример #1
0
        public void CaculateScoreTest()
        {
            VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值

            target._correct          = 5;
            target._numberOfQuestion = 20;
            target.CalculateScore();
            Assert.AreEqual((double)5 / (double)20 * (double)100, target._score);
            target._correct          = 1;
            target._numberOfQuestion = 3;
            target.CalculateScore();
            Assert.AreEqual((double)1 / (double)3 * (double)100, target._score);
        }
Пример #2
0
 public void CaculateScoreTest()
 {
     VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值
     target._correct = 5;
     target._numberOfQuestion = 20;
     target.CalculateScore();
     Assert.AreEqual((double)5 / (double)20 * (double)100, target._score);
     target._correct = 1;
     target._numberOfQuestion = 3;
     target.CalculateScore();
     Assert.AreEqual((double)1 / (double)3 * (double)100, target._score);
 }
Пример #3
0
        public void GetScoreTest()
        {
            VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值

            target._correct          = 20;
            target._numberOfQuestion = 25;
            target.CalculateScore();
            double expected = target._score;
            double actual;

            actual = target.Score;
            Assert.AreEqual(expected, actual);
        }
Пример #4
0
 public void GetScoreTest()
 {
     VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值
     target._correct = 20;
     target._numberOfQuestion = 25;
     target.CalculateScore();
     double expected = target._score;
     double actual;
     actual = target.Score;
     Assert.AreEqual(expected, actual);
 }