Пример #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 CommandLineParser(new CommandLineParserSettings(false,  false, writer)).ParseArguments(new string[0], options, writer);

            options.LastParserState.Errors.Should().HaveCount(n => n == 2);
              }
        }
Пример #2
0
        public void MultipleRequiredFields_WithMoreThanOneRequiredFieldNotSpecified_ReportsAllMissingRequiredFields()
        {
            var options = new ComplexOptions();
              using (var writer = new StringWriter())
              {
            new CommandLineParser(new CommandLineParserSettings(false,  false, writer)).ParseArguments(new string[0], options, writer);

            options.LastParserState.Errors.Should().Count.Exactly(2);
              }
        }
Пример #3
0
        public void MultipleRequiredFields_WithMoreThanOneRequiredFieldNotSpecified_ReportsAllMissingRequiredFields()
        {
            var options = new ComplexOptions();
              using (var writer = new StringWriter())
              {
            new CommandLineParser(new CommandLineParserSettings(false,  false, writer)).ParseArguments(new string[0], options, writer);

            Assert.AreEqual(2, options.InternalLastPostParsingState.Errors.Count);
              }
        }