Exemplo n.º 1
0
        public void WhenWordIsPluralThenWordServiceShouldReturnTrue()
        {
            var word = "ducks";

            _wordExistenceHelper
            .DoesWordExist(word)
            .Returns(false);

            _wordHelper
            .StrippedSuffixDictionaryCheck(Arg.Any <Dictionary>(), word)
            .Returns(true);

            var wordService = new WordService(_wordExistenceHelper, _wordHelper, _wordDefinitionHelper, _fileHelper, _filenameHelper);
            var response    = wordService.GetWordStatus(Filename, word);

            response.Should().BeTrue();
        }
Exemplo n.º 2
0
        public bool GetWordStatus(string filename, string word)
        {
            var wordExists = _wordExistenceHelper.DoesWordExist(word);

            if (wordExists)
            {
                return(true);
            }

            wordExists = _wordHelper.StrippedSuffixDictionaryCheck(_dictionary, word);

            return(wordExists);
        }