예제 #1
0
        public void Multiple_required_fields_with_more_than_one_required_field_not_specified_reports_all_missing_required_fields()
        {
            var options = new ComplexOptions();
            using (var writer = new StringWriter())
            {
                new CommandLine.Parser(new ParserSettings(false,  false, writer)).ParseArguments(new string[0], options);

                options.LastParserState.Errors.Should().HaveCount(n => n == 2);
            }
        }
예제 #2
0
        public void Parser_should_report_missing_value()
        {
            var options = new ComplexOptions();
            var parser = new Parser();
            var result = parser.ParseArguments(new[] { "-i", "-o" }, options);

            result.Should().BeFalse();

            options.LastParserState.Errors.Count.Should().BeGreaterThan(0);
        }