Ejemplo n.º 1
0
        public void should_throw_if_free_value_conflict(string conflictName)
        {
            CommandBuilder builder = new ArgsParserBuilder().BeginCommand("command", string.Empty);

            builder.AddFreeValue("name", "original");
            Assert.Throws <ArgumentException>(() => builder.AddFreeValue(conflictName, "conflict"));
        }
Ejemplo n.º 2
0
        public void should_not_mark_a_free_value_as_mandatory_if_the_previous_free_value_is_not()
        {
            CommandBuilder builder = new ArgsParserBuilder()
                                     .BeginDefaultCommand()
                                     .AddFreeValue("free_value1", string.Empty);

            Assert.Throws <InvalidOperationException>(() => builder.AddFreeValue("free_value2", string.Empty, true));
        }
Ejemplo n.º 3
0
        public void should_throw_if_free_value_name_is_null()
        {
            CommandBuilder builder = new ArgsParserBuilder().BeginDefaultCommand();

            Assert.Throws <ArgumentNullException>(() => builder.AddFreeValue(null, string.Empty));
        }