public void ChangeTheStateOfAWordTest()
        {
            var v = new Vocabulary
            {
                Word        = "changeStateTest",
                Translation = "改变状态位测试",
                YesorNo     = 0
            };

            CustomDicManage.AddACustomDictionary("changeStateTest");
            Assert.AreEqual(1, CustomDicManage.InsertAVocabularyToCustomDictionary("changeStateTest", v));
            using (var db = new DataContext())
            {
                db.Database.Migrate();
                var test = db.Words.First(vo => vo.Id.Equals(v.Word));
                Assert.AreEqual(0, test.YesorNo);
                db.Database.CloseConnection();
            }

            CustomDicManage.ChangeTheStateOfAWord(v.Word, 1);

            using (var db = new DataContext())
            {
                db.Database.Migrate();
                var test = db.Words.First(vo => vo.Id.Equals(v.Word));
                Assert.AreEqual(1, test.YesorNo);
                db.Database.CloseConnection();
            }
        }
        public void InsertAVocabularyToCustomDictionaryTest()
        {
            // CustomDicManage.AddACustomDictionary("InsertTestDic");
            //Assert.AreEqual(0, CustomDicManage.InsertAVocabularyToCustomDictionary("InsertTestDic",
            //  new Vocabulary
            //  {
            //      Word = "01Test", Translation = "单词关联词典插入测试"
            //  }));

            Assert.AreEqual(1, CustomDicManage.InsertAVocabularyToCustomDictionary("InsertTestDic",
                                                                                   new Vocabulary
            {
                Word        = "test",
                Translation = "测试"
            }));
        }
 public void DeleteDictionaryTest()
 {
     CustomDicManage.AddACustomDictionary("DeleteTestDic");
     Assert.AreEqual(1, CustomDicManage.InsertAVocabularyToCustomDictionary("DeleteTestDic",
                                                                            new ExReaderPlus.WordsManager.Vocabulary
     {
         Word        = "001Test",
         Translation = "单词关联词典插入测试"
     }));
     Assert.AreEqual(1, CustomDicManage.InsertAVocabularyToCustomDictionary("DeleteTestDic",
                                                                            new ExReaderPlus.WordsManager.Vocabulary
     {
         Word        = "002Test",
         Translation = "单词关联词典插入测试"
     }));
     Assert.AreEqual(1, CustomDicManage.InsertAVocabularyToCustomDictionary("DeleteTestDic",
                                                                            new ExReaderPlus.WordsManager.Vocabulary
     {
         Word        = "003Test",
         Translation = "单词关联词典插入测试"
     }));
     Assert.AreEqual(1, CustomDicManage.DeleteDictionary("DeleteTestDic"));
 }