public void WhenWordDoesNotExistAndDoesNotReturnWordFormsThenResponseShouldBeFalse() { var nonExistentWord = "sheeps"; var responseString = "There once was a sheep called simon, whose fleece was as shiny as diamond, he ate grass all day, through the night he did play, and now he just sleeps through the day"; _webDictionaryRequestHelper .MakeContentRequest("sheeps") .Returns(responseString); var wordHelper = new WordHelper(_webDictionaryRequestHelper, _wordExistenceHelper, _wordDefinitionHelper, _fileHelper, _temporaryDefinitionHelper); var response = wordHelper.CheckWordWithEndingExists(nonExistentWord, "sheeps"); response.Should().BeFalse(); }
public void WhenSiteContainsWordFormsAndWordExistsThenResponseShouldBeTrue() { var word = "diamond"; var responseString = "Word forms: There once was a sheep called simon, whose fleece was as shiny as diamonds, he ate grass all day, through the night he did play, and now he just sleeps through the day"; _webDictionaryRequestHelper .MakeContentRequest("diamond") .Returns(responseString); var wordHelper = new WordHelper(_webDictionaryRequestHelper, _wordExistenceHelper, _wordDefinitionHelper, _fileHelper, _temporaryDefinitionHelper); var response = wordHelper.CheckWordWithEndingExists(word, "diamond"); response.Should().BeTrue(); }
public void WhenWordExistsResponseShouldBeTrue() { var word = "ended"; var responseString = "Word forms: There once was a sheep called Ollie, who jumped through the hedge by a lorry, the man hit the brakes, the sheep made mistakes, but all ended well and he's jolly"; _webDictionaryRequestHelper .MakeContentRequest("end") .Returns(responseString); var wordHelper = new WordHelper(_webDictionaryRequestHelper, _wordExistenceHelper, _wordDefinitionHelper, _fileHelper, _temporaryDefinitionHelper); var response = wordHelper.CheckWordWithEndingExists(word, "end"); response.Should().BeTrue(); }