TEST_FIXTURE(EnchantDictionaryIsAdded_TestFixture, EnchantDictionaryIsAdded_WordExistsInPwlAndExclude_0) { ExternalAddWordToDictionary("hello"); ExternalAddWordToExclude("hello"); ReloadTestDictionary(); CHECK_EQUAL(0, enchant_dict_is_added(_dict, "hello", -1)); }
TEST_FIXTURE(EnchantDictionaryCheck_TestFixture, EnchantDictionaryCheck_WordInDictionaryAndExclude_1) { ExternalAddWordToExclude("hello"); ExternalAddWordToDictionary("hello"); ReloadTestDictionary(); CHECK_EQUAL(1, enchant_dict_check(_dict, "hello", -1)); }
TEST_FIXTURE(EnchantDictionaryAdd_TestFixture, EnchantDictionaryAdd_IsPermanent) { enchant_dict_add(_dict, "hello", -1); CHECK(IsWordInDictionary("hello")); ReloadTestDictionary(); CHECK(IsWordInDictionary("hello")); }
TEST_FIXTURE(EnchantDictionaryAddToSession_TestFixture, EnchantDictionaryAddToSession_IsNotPermanent) { enchant_dict_add_to_session(_dict, "hello", -1); CHECK(IsWordInSession("hello")); ReloadTestDictionary(); CHECK(!IsWordInSession("hello")); }
TEST_FIXTURE(EnchantDictionarySuggestNotImplemented_TestFixture, EnchantDictionarySuggest_WordInDictionaryAndExclude_NotInSuggestions) { ExternalAddWordToExclude("hello"); ExternalAddWordToDictionary("hello"); ReloadTestDictionary(); size_t cSuggestions; _suggestions = enchant_dict_suggest(_dict, "helo", -1, &cSuggestions); CHECK(!_suggestions); CHECK_EQUAL(0, cSuggestions); }
TEST_FIXTURE(EnchantDictionarySuggest_TestFixture, EnchantDictionarySuggest_WordNfcInDictionaryNfdInPwl_ReturnsFromDict) { suggestBehavior = returnFianceNfc; ExternalAddWordToDictionary(Convert(L"fiance\x301")); // NFD u0301 = Combining acute accent ReloadTestDictionary(); size_t cSuggestions; _suggestions = enchant_dict_suggest(_dict, "fiance", -1, &cSuggestions); CHECK(_suggestions); CHECK_EQUAL(1, cSuggestions); CHECK_EQUAL(Convert(L"fianc\xe9"), _suggestions[0]); }