public void Value_option_attribute_values_are_not_mandatory() { var options = new SimpleOptionsWithValueOption(); var parser = new Parser(); var result = parser.ParseArguments( new string[] { "--switch" }, options); result.Should().BeTrue(); options.BooleanValue.Should().BeTrue(); options.StringItem.Should().BeNull(); options.IntegerItem.Should().Be(0); options.NullableDoubleItem.Should().NotHaveValue(); }
public void Value_option_attribute_isolates_non_option_values() { var options = new SimpleOptionsWithValueOption(); var parser = new Parser(); var result = parser.ParseArguments( new string[] { "--switch", "file.ext", "1000", "0.1234", "-s", "out.ext" }, options); result.Should().BeTrue(); options.BooleanValue.Should().BeTrue(); options.StringItem.Should().Be("file.ext"); options.IntegerItem.Should().Be(1000); options.NullableDoubleItem.Should().Be(0.1234D); options.StringValue.Should().Be("out.ext"); }