public void ShouldCallCustomValidator() { var args = new [] { "--stringValue=foo", "-n1" }; var parser = new OptionsParser(new ParserConfiguration { ThrowValidationException = true }); var options = new OptionsWithCustomValidator(); try { parser.Parse(options, args); Assert.Fail("Expected exception"); } catch (ValidationException) { Assert.AreEqual(1, options.NumericValue); Assert.AreEqual("foo", options.StringValue); } }