public void TestSimpleModelWithSimpleValidator() { CommandLineArgumentsDefinition definition = new CommandLineArgumentsDefinition(); var definitionString = definition.ToString(); // Make sure it doesn't throw var argument = new CommandLineArgument(typeof(int), "somenumber"); definition.Arguments.Add(argument); argument.Metadata.Add(new ArgRequired()); try { Args.Parse(definition, new string[] { }); Assert.Fail("An exception should have been thrown"); } catch (MissingArgException ex) { Assert.IsTrue(ex.Message.Contains("somenumber")); } }