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

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

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

            var result = preprocessor.Process(null);

            result.IsSuccess.Should().BeFalse();
        }
Exemple #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);
        }
Exemple #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);
        }