public void Parser_state_attribute_should_be_applied_to_a_property_of_the_correct_type_also_if_not_initialized() { var options = new FakeOptionsWithParserStateAttributeAppliedInWrongWayAndNotInitialized(); Assert.ThrowsDelegate act = () => new CommandLine.Parser( with => with.HelpWriter = new StringWriter()).ParseArguments(new[] { "--foo" }, options); Assert.Throws <InvalidOperationException>(act); }
public void Parser_state_attribute_should_be_applied_to_a_property_of_the_correct_type_also_if_not_initialized() { var options = new FakeOptionsWithParserStateAttributeAppliedInWrongWayAndNotInitialized(); Assert.ThrowsDelegate act = () => new CommandLine.Parser( with => with.HelpWriter = new StringWriter()).ParseArguments(new[] { "--foo" }, options); Assert.Throws<InvalidOperationException>(act); }