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")); }
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); }
public void Remove_HasNullParameters(string fromWord, string fromLanguage) { Assert.ThrowsException <ArgumentNullException>(() => TranslationHandler.Remove(null, fromLanguage)); Assert.ThrowsException <ArgumentNullException>(() => TranslationHandler.Remove(fromWord, null)); }