Exemple #1
0
        public void AnalyzedWordsShouldBeLowercase()
        {
            wordReader.AddWords(new[] { "FirsT", "first" });
            var words = wordsAnalyzer.AnalyzeWords();

            words.Value.Count.Should().Be(1);
        }
Exemple #2
0
        public void AnalyzeWordsShouldIgnoreBoringWords()
        {
            options.BoringWords = new[] { "first" };
            wordsAnalyzer       = new WordsAnalyzer(new Filter(options), wordReader);
            wordReader.AddWords(new [] { "first", "second" });
            var words = wordsAnalyzer.AnalyzeWords();

            words.Count.Should().Be(1);
        }
Exemple #3
0
        public void AnalyzeWordsShouldntBeSuccess_WenMystemLocationIncorrect()
        {
            options.MystemLocation = "incorrect";
            wordsAnalyzer          = new WordsAnalyzer(new Filter(options), wordReader);
            wordReader.AddWords(new[] { "first", "second" });
            var words = wordsAnalyzer.AnalyzeWords();

            words.IsSuccess.Should().BeFalse();
        }
Exemple #4
0
 public void AnalyzeWordsShouldReturnEmpty_WhenNoWordsWereFound()
 {
     wordsAnalyzer.AnalyzeWords().Count.Should().Be(0);
 }
Exemple #5
0
 public void MakeTagCloud()
 {
     rectangleLayout.PlaceWords(wordsAnalyzer.AnalyzeWords());
     rectangleLayout.DrawLayout();
 }
Exemple #6
0
 public Result <None> MakeTagCloud() =>
 wordsAnalyzer.AnalyzeWords()
 .Then(rectangleLayout.PlaceWords)
 .Then(_ => rectangleLayout.DrawLayout());