public void YouCannotAddDuplicatesOptional() { var parser = new CommandlineArgumentRules { new OptionalCommandlineArgumentRule("a") }; Assert.Throws <ArgumentException>(() => { parser.Add(new OptionalCommandlineArgumentRule("a")); }); }
public void YouCannotAddMultipleDuplicatesOptional() { var parser = new CommandlineArgumentRules { new OptionalCommandlineArgumentRule(new [] { "a", "b", "c" }) }; // alias 'a' is duplicated. Assert.Throws <ArgumentException>(() => { parser.Add(new OptionalCommandlineArgumentRule(new [] { "x", "y", "a" })); }); }
public void YouCannotHaveDuplicates() { Assert.Throws <ArgumentException>(() => { var _ = new CommandlineArgumentRules { new OptionalCommandlineArgumentRule("a"), new OptionalCommandlineArgumentRule("a"), }; }); }