public static ResetDictionary ( string id, IEnumerable |
||
id | string | |
words | IEnumerable |
|
리턴 | void |
public void ResetDictionary_AddsNoWordsToNonPrivate() { MakeNonPrivateBlahDictionary(); SpellingHelper.ResetDictionary("blah", new[] { "hello", "world" }); var filePath = SpellingHelper.GetDicPath(SpellingHelper.GetSpellingDirectoryPath(), "blah"); var contents = File.ReadAllText(filePath); Assert.That(contents, Is.Not.StringContaining(SpellingHelper.PrototypeWord)); Assert.That(contents, Is.Not.StringContaining("hello")); Assert.That(contents, Is.Not.StringContaining("world")); Assert.That(contents, Contains.Substring("blah")); }
public void ResetDictionaryAddsAllWords() { var id = MakeEmptyFooDictionary(); var dict = SpellingHelper.GetSpellChecker(id); dict.SetStatus("old", true); Assert.That(dict.Check("old"), Is.True); SpellingHelper.ResetDictionary(id, new[] { "hello", "wo\x0302rld", "this", "is", "a", "test" }); dict = SpellingHelper.GetSpellChecker(id); Assert.That(dict.Check("old"), Is.False); Assert.That(dict.Check("hello"), Is.True); Assert.That(dict.Check("w\x00f4rld"), Is.True); Assert.That(dict.Check("wo\x0302rld"), Is.True); // decomposed form. Assert.That(dict.Check("is"), Is.True); Assert.That(dict.Check("a"), Is.True); Assert.That(dict.Check("test"), Is.True); }