Ejemplo n.º 1
0
 public void SetUp()
 {
     wordCounter = Substitute.For <IWordCounter>();
     wordCounter.GetCountedWords(Arg.Any <IEnumerable <Word> >()).Returns(w => w[0]);
     wordSelector = Substitute.For <IWordSelector>();
     wordSelector.IsSelectedWord(null).ReturnsForAnyArgs(true);
 }
Ejemplo n.º 2
0
        public IEnumerable<Word> PrepareWords(IEnumerable<string> rawWords)
        {
            var convertedWords = rawWords
                .Select(rawWord => rawWord.ToLower())
                .Select(word => new Word(word));
            var countedWords = wordCounter.GetCountedWords(convertedWords);
            return countedWords
                .Where(word => wordSelector.IsSelectedWord(word));

        }