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); }
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)); }