public void WordsHandler_Should_ConvertWordsCorrectly() { var expectedDictionary = new Dictionary <string, int> { { "i", 4 }, { "boat", 4 } }; var primaryCollection = wordsHandler.GetWordsAndCount(fileReader.ReadWordsFromFile(pathToReadWords).GetValueOrThrow()); wordsHandler.RemoveBoringWords(primaryCollection.GetValueOrThrow(), pathToBoringWords) .GetValueOrThrow() .Should() .BeEquivalentTo(expectedDictionary); }
public Result <List <Tag> > Create(ImageSettings imageSettings, string path) { return(fileReader.ReadWordsFromFile(path) .Then(words => wordsHandler.GetWordsAndCount(words)) .Then(wordsAndCount => wordsHandler.RemoveBoringWords(wordsAndCount, $"{GetCurrentDirectoryPath()}\\BoringWords.txt")) .Then(wordsAfterConversion => parser.GetTags(wordsAfterConversion, imageSettings))); }