Exemplo n.º 1
0
        public void Parser_state_attribute_should_be_applied_to_a_property_of_the_correct_type()
        {
            var options = new FakeOptionsWithParserStateAttributeAppliedInWrongWay();

            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()
        {
            var options = new FakeOptionsWithParserStateAttributeAppliedInWrongWay();

            Assert.ThrowsDelegate act = () => new CommandLine.Parser(
                with => with.HelpWriter = new StringWriter()).ParseArguments(new[] { "--foo" }, options);

            Assert.Throws <InvalidOperationException>(act);
        }