public FindWordsResponseMessage FindWords(FindWordsRequestMessage message) { return(new FindWordsResponseMessage() { SearchPattern = message.Pattern.ToLower(), Letters = message.Letters?.ToLower(), Words = wordFinder.FindWords(message.Pattern, message.Letters?.ToLower()) }); }
public void GivenMixedCaseLetters_ThenLettersInReponseAreLowerCase() { var request = new FindWordsRequestMessage() { Pattern = "$pple", Letters = "A" }; var response = requestHandler.FindWords(request); response.Letters.ShouldBe("a"); }
public void GivenMixedCasePattern_ThenSearchPatternInReponseIsLowerCase() { var request = new FindWordsRequestMessage() { Pattern = "$PPle" }; var response = requestHandler.FindWords(request); response.SearchPattern.ShouldBe("$pple"); }
public void GivenAMessageWithLetters_ThenWordFinderIsCalledWithLetters() { var request = new FindWordsRequestMessage() { Pattern = "$pple", Letters = "a" }; requestHandler.FindWords(request); wordFinder.Received(1).FindWords("$pple", "a"); }
public void GivenAMessage_ThenWordFinderIsCalled() { var request = new FindWordsRequestMessage() { Pattern = "$pple" }; requestHandler.FindWords(request); wordFinder.Received(1).FindWords("$pple"); }
public FindWordsResponseMessage FindWords([FromBody] FindWordsRequestMessage message) { return(findWordsRequestHandler.FindWords(message)); }