Example #1
0
        public void ThrowException_WhenWordsAreNull()
        {
            var settings     = new WordsPreprocessorSettings();
            var preprocessor = new BoringWordsExcluder(settings);

            Action runner = () => preprocessor.Process(null);

            runner.Should().Throw <ArgumentNullException>();
        }
Example #2
0
        public void BeNotSucceed_WhenWordsAreNull()
        {
            var settings     = new WordsPreprocessorSettings();
            var preprocessor = new BoringWordsExcluder(settings);

            var result = preprocessor.Process(null);

            result.IsSuccess.Should().BeFalse();
        }
Example #3
0
        public void ExcludeBoringWords(int length)
        {
            var settings = new WordsPreprocessorSettings
            {
                BoringWordsLength = length
            };
            var preprocessor = new BoringWordsExcluder(settings);

            var result = preprocessor.Process(words);

            result.Should().NotContain(str => str.Length < length);
        }
Example #4
0
        public void ExcludeGivenWords(params string[] wordsToExclude)
        {
            var settings = new WordsPreprocessorSettings
            {
                ExcludedWords = wordsToExclude
            };
            var preprocessor = new BoringWordsExcluder(settings);

            var result = preprocessor.Process(words);

            result.Should().NotContain(wordsToExclude);
        }
Example #5
0
 public CloudDrawAction(IFileReader reader,
                        IWordsPreprocessor[] preprocessors,
                        FrequencyCounter frequencyCounter,
                        WordsPreprocessorSettings preprocessorSettings,
                        IFilePathProvider filePath,
                        TagCloudPainter painter,
                        LayouterApplicator applicator,
                        PictureBoxImageHolder imageHolder)
 {
     this.reader               = reader;
     this.preprocessors        = preprocessors;
     this.frequencyCounter     = frequencyCounter;
     this.preprocessorSettings = preprocessorSettings;
     this.filePath             = filePath;
     this.painter              = painter;
     this.applicator           = applicator;
     this.imageHolder          = imageHolder;
 }