public void BlackListWordsFilter_ShouldThrow_IfCollectionIsNull() { var filter = new BlackListWordsFilter(new string[0], normalizer); Action action = () => filter.Validate(null); action.Should().Throw <NullReferenceException>(); }
public void BlacklistWordsFilter_ShouldPassWords_ThatAreNotInBlackList( IEnumerable <string> blackList, string word, bool expectedResult) { var filter = new BlackListWordsFilter(blackList, normalizer); var wordPassed = filter.Validate(word); wordPassed.Should().Be(expectedResult); }
public SetExcludingWordsForm(BlackListWordsFilter filter) { var okButton = new Button { Text = "OK", DialogResult = DialogResult.OK, Dock = DockStyle.Bottom }; textBox = new TextBox { Multiline = true, Dock = DockStyle.Fill, ScrollBars = ScrollBars.Vertical, Text = string.Join(Environment.NewLine, filter.BlackList) + Environment.NewLine }; this.filter = filter; okButton.Click += OnOkButtonClick; Controls.Add(okButton); Controls.Add(textBox); }