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

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

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

            var result = preprocessor.Process(null);

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