예제 #1
0
        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();
        }
예제 #2
0
        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();
        }
예제 #3
0
        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();
        }