public void GetNumberOfVocbularyTest()
 {
     Dictionary target = new Dictionary(); // TODO: 初始化為適當值
     target.LoadWords("../../../Dictionary2000.txt");
     int expected = 2074; // TODO: 初始化為適當值
     int actual;
     actual = target.NumberOfVocabulary;
     Assert.AreEqual(expected, actual);
 }
 public void GetWordTest()
 {
     Dictionary target = new Dictionary(); // TODO: 初始化為適當值
     target.LoadWords("../../../Dictionary2000.txt");
     int index = 34; // TODO: 初始化為適當值
     Word actual;
     actual = target.GetWord(index);
     Assert.AreEqual("[動詞] 同意",actual.Chinese);
     Assert.AreEqual("agree", actual.English);
 }
 public void CreateNewQuestionTest()
 {
     Dictionary questionLibrary = new Dictionary(); // TODO: 初始化為適當值
     questionLibrary.LoadWords("dictionary2000.txt");
     SelectionQuestion_Accessor target = new SelectionQuestion_Accessor(questionLibrary); // TODO: 初始化為適當值
     target.CreateNewQuestion();
     Word first = target._testedVocabulary;
     Assert.AreEqual(1, target._isTestedIndex.Count);
     Assert.AreEqual(4, target._selection.Count);
     target.CreateNewQuestion();
     Word second = target._testedVocabulary;
     Assert.AreEqual(2, target._isTestedIndex.Count);
     Assert.AreNotEqual(first.English, second.English);
 }
 public void GetAnswerTest()
 {
     Dictionary questionLibrary = new Dictionary(); // TODO: 初始化為適當值
     SelectionQuestion_Accessor target = new SelectionQuestion_Accessor(questionLibrary); // TODO: 初始化為適當值
     string expected1 = "accept"; // TODO: 初始化為適當值
     string expected2 = "[動詞] 接受";
     questionLibrary.LoadWords("dictionary2000.txt");
     target._testedVocabulary = questionLibrary.GetWord(10);
     target._isChineseSelection = false;
     string actual;
     actual = target.Answer;
     Assert.AreEqual(expected1, actual);
     target._isChineseSelection = true;
     actual = target.Answer;
     Assert.AreEqual(expected2, actual);
 }
        public void CreatNewSelectionQuestionTest()
        {
            VocabularyMode_Accessor target = new VocabularyMode_Accessor(); // TODO: 初始化為適當值
            Dictionary dictionary = new Dictionary();
            target.Initialize();
            List<string> actual;
            dictionary.LoadWords("dictionary2000.txt");
            actual = target.CreateNewSelectionQuestion();
            if (target._selectionQuestion.IsChineseSelection)
            {
                for (int i = 0; i < 4; i++)
                    Assert.AreEqual(true, actual.Contains(dictionary.GetWord(target._selectionQuestion.Selection[i]).Chinese));
            }
            else
            {
                for (int i = 0; i < 4; i++)
                    Assert.AreEqual(true, actual.Contains(dictionary.GetWord(target._selectionQuestion.Selection[i]).English));

            }
        }
 public void CreateNewQuestionTest()
 {
     Dictionary dictionary = new Dictionary();
     FillQuestion_Accessor target = new FillQuestion_Accessor(dictionary); // TODO: 初始化為適當值
     dictionary.LoadWords("dictionary2000.txt");
     target.CreateNewQuestion();
     string first = target.QuestionStatement;
     target.CreateNewQuestion();
     string second = target.QuestionStatement;
     Assert.AreNotEqual(first, second);
     Assert.AreEqual(2, target._isTestedIndex.Count);
 }
 public void SelectionTest()
 {
     Dictionary questionLibrary = new Dictionary(); // TODO: 初始化為適當值
     SelectionQuestion_Accessor target = new SelectionQuestion_Accessor(questionLibrary); // TODO: 初始化為適當值
     questionLibrary.LoadWords("dictionary2000.txt");
     target.CreateNewQuestion();
     List<int> actual;
     actual = target.Selection;
     Assert.AreEqual(4, actual.Count);
     int index = -1;
     for (int i = 0; i < questionLibrary.NumberOfVocabulary; i++)
     {
     if (questionLibrary.GetWord(i).English == target.Question)
     {
     index = i;
     break;
     }
     }
     Assert.AreEqual(true, target._selection.Contains(index));
     for (int i = 0; i < 3; i++)
     {
     for (int j = i+1; j < 4; j++)
     {
     Assert.AreNotEqual(target._selection[i], target._selection[j]);
     }
     }
 }
 public void InitializeTest()
 {
     Dictionary questionLibrary = new Dictionary(); // TODO: 初始化為適當值
     SelectionQuestion_Accessor target = new SelectionQuestion_Accessor(questionLibrary); // TODO: 初始化為適當值
     questionLibrary.LoadWords("dictionary2000.txt");
     target.CreateNewQuestion();
     target.Initialize();
     Assert.AreEqual(0,target._selection.Count);
     Assert.AreEqual(0, target._isTestedIndex.Count);
 }
 public void GetQuestionTest()
 {
     Dictionary questionLibrary = new Dictionary(); // TODO: 初始化為適當值
     SelectionQuestion_Accessor target = new SelectionQuestion_Accessor(questionLibrary); // TODO: 初始化為適當值
     string expected = "accept"; // TODO: 初始化為適當值
     questionLibrary.LoadWords("dictionary2000.txt");
     target._testedVocabulary = questionLibrary.GetWord(10);
     string actual;
     actual = target.Question;
     Assert.AreEqual(expected, actual);
 }