예제 #1
0
 public FindWordsResponseMessage FindWords(FindWordsRequestMessage message)
 {
     return(new FindWordsResponseMessage()
     {
         SearchPattern = message.Pattern.ToLower(),
         Letters = message.Letters?.ToLower(),
         Words = wordFinder.FindWords(message.Pattern, message.Letters?.ToLower())
     });
 }
예제 #2
0
        public void GivenMixedCaseLetters_ThenLettersInReponseAreLowerCase()
        {
            var request = new FindWordsRequestMessage()
            {
                Pattern = "$pple", Letters = "A"
            };
            var response = requestHandler.FindWords(request);

            response.Letters.ShouldBe("a");
        }
예제 #3
0
        public void GivenMixedCasePattern_ThenSearchPatternInReponseIsLowerCase()
        {
            var request = new FindWordsRequestMessage()
            {
                Pattern = "$PPle"
            };
            var response = requestHandler.FindWords(request);

            response.SearchPattern.ShouldBe("$pple");
        }
예제 #4
0
        public void GivenAMessageWithLetters_ThenWordFinderIsCalledWithLetters()
        {
            var request = new FindWordsRequestMessage()
            {
                Pattern = "$pple", Letters = "a"
            };

            requestHandler.FindWords(request);
            wordFinder.Received(1).FindWords("$pple", "a");
        }
예제 #5
0
        public void GivenAMessage_ThenWordFinderIsCalled()
        {
            var request = new FindWordsRequestMessage()
            {
                Pattern = "$pple"
            };

            requestHandler.FindWords(request);
            wordFinder.Received(1).FindWords("$pple");
        }
예제 #6
0
 public FindWordsResponseMessage FindWords([FromBody] FindWordsRequestMessage message)
 {
     return(findWordsRequestHandler.FindWords(message));
 }