Exemple #1
0
        public void RemoveRecord_ThrowNotFoundException(string fromWord,
                                                        string fromLanguage, string toWord,
                                                        string toLanguage)
        {
            // int count = TranslationHandler.Translations.Count;
            TranslationHandler.AddEntry(fromWord, fromLanguage, toWord, toLanguage);

            Assert.ThrowsException <Exception>(() => TranslationHandler.Remove("a", fromLanguage));
            Assert.ThrowsException <Exception>(() => TranslationHandler.Remove(fromWord, "a"));
        }
Exemple #2
0
        public void RemoveRecord_RemovesRecord(string fromWord,
                                               string fromLanguage, string toWord,
                                               string toLanguage)
        {
            int count = TranslationHandler.Translations.Count;

            TranslationHandler.AddEntry(fromWord, fromLanguage, toWord, toLanguage);
            TranslationHandler.Remove(fromWord, fromLanguage);
            Assert.AreEqual(count, TranslationHandler.Translations.Count);

            TranslationHandler.AddEntry(fromWord, fromLanguage, toWord, toLanguage);
            TranslationHandler.Remove(toWord, toLanguage);
            Assert.AreEqual(count, TranslationHandler.Translations.Count);
        }
Exemple #3
0
 public void Remove_HasNullParameters(string fromWord, string fromLanguage)
 {
     Assert.ThrowsException <ArgumentNullException>(() => TranslationHandler.Remove(null, fromLanguage));
     Assert.ThrowsException <ArgumentNullException>(() => TranslationHandler.Remove(fromWord, null));
 }