Ejemplo n.º 1
0
 public void OptionsNoValue() =>
 Assert.Throws <CommandLineCheckException>(
     () => CommandLineHelper.Check("program /opt1-", new CmdLineRules(new OptionRule("opt1", OptionType.Value))));
Ejemplo n.º 2
0
 public void UnknownCommands() =>
 Assert.Throws <CommandLineCheckException>(
     () => CommandLineHelper.Check("program cmd1 cmd2 cmd3", new CmdLineRules(new CommandRule("cmd2"))));
Ejemplo n.º 3
0
 public void UnknownOptions() =>
 Assert.Throws <CommandLineCheckException>(
     () => CommandLineHelper.Check("program /opt1 /opt2 /opt3", new CmdLineRules(new OptionRule("opt1"))));
Ejemplo n.º 4
0
 public void LocalReqOption() =>
 CommandLineHelper.Check(
     "program",
     new CmdLineRules(new OptionRule("opt1", OptionType.Bool, true, "cmd1")));
Ejemplo n.º 5
0
 public void GlobalReqOption() =>
 Assert.Throws <CommandLineCheckException>(
     () => CommandLineHelper.Check("program", new CmdLineRules(new OptionRule("opt1", OptionType.Bool, true))));
Ejemplo n.º 6
0
 public void NoDepCommand() =>
 Assert.Throws <CommandLineCheckException>(
     () =>
     CommandLineHelper.Check(
         "program /opt1+",
         new CmdLineRules(new OptionRule("opt1", OptionType.Bool, true, "cmd1"))));
Ejemplo n.º 7
0
 public void ParseNoOptionValue() =>
 Assert.Throws <ParsingException>(() => CommandLineHelper.ParseCommandLine("program /aa= "));
Ejemplo n.º 8
0
 public void ParseNoCloseQuota() =>
 Assert.Throws <ParsingException>(() => CommandLineHelper.ParseCommandLine("\"program"));