public void YandexDictionary_Create(IYandexSpeller yandexSpeller, MockExternalDictionary mockExternalDictionary) { IYandexDictionary yandex = new YandexDictionary(yandexSpeller, mockExternalDictionary); var word = _fixture.Create<string>(); Error error; Assert.False(yandex.ContainsWord(word, Lang.En, out error)); yandex.AddWord(word, Lang.En); Assert.True(yandex.ContainsWord(word, Lang.En, out error)); }
public void YandexDictionary_YandexAPIRequest(IYandexSpeller yandexSpeller, MockExternalDictionary mockExternalDictionary) { IYandexDictionary yandex = new YandexDictionary(yandexSpeller, mockExternalDictionary); var word = _fixture.Create<string>(); Error error; Mock.Get(yandexSpeller) .Setup(x => x.CheckText(word, Lang.En, It.IsAny<Options>(), It.IsAny<TextFormat>())) .Returns(new SpellResult {Errors = new List<Error>()}); Assert.True(yandex.ContainsWord(word, Lang.En, out error)); }