public void Test(bool wholeWords, string input, bool isAllowed) { var processor = new ValidateInput { WholeWordsOnly = wholeWords }; var args = new ProfanityFilterArgs { Input = input, WordList = new List <string> { "x", "y" } }; processor.Process(args); if (isAllowed) { Assert.That(args.Valid, Is.True); } else { Assert.That(args.Valid, Is.False); } }