Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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)));
 }