public void ParseInvalidLongName2() { SwitchArgument argument = new SwitchArgument("switch", ""); int i = 1; var result = argument.Parse(new[] { "/switch1", "--switch:" }, ref i); Assert.IsNull(result); Assert.AreEqual(1, i); }
public void ParseInvalidLongName1() { SwitchArgument argument = new SwitchArgument("switch", ""); int i = 1; var result = argument.Parse(new[] { "--switch1", "-switch" }, ref i); Assert.IsNull(result); Assert.AreEqual(1, i); }
public void ParseLongName2() { SwitchArgument argument = new SwitchArgument("switch", ""); int i = 1; var result = argument.Parse(new[] { "--switch1", "--SwItcH" }, ref i); Assert.IsNotNull(result); Assert.AreEqual(2, i); }
public void ParseOther() { SwitchArgument argument = new SwitchArgument("switch", "", null, new[] { 'S' }); int i = 0; var result = argument.Parse(new[] { "--switch1", "--switch" }, ref i); Assert.IsNull(result); Assert.AreEqual(0, i); }
public void ParseShortNameAlias() { SwitchArgument argument = new SwitchArgument("switch", "", null, new[] { 'S', 'A' }); int i = 1; var result = argument.Parse(new[] { "--switch1", "-A" }, ref i); Assert.IsNotNull(result); Assert.AreEqual(2, i); }
public void ParseInvalidShortName3() { SwitchArgument argument = new SwitchArgument("switch", "", null, new[] { 'S' }); int i = 1; var result = argument.Parse(new[] { "--switch1", "--S" }, ref i); Assert.IsNull(result); Assert.AreEqual(1, i); }
public void ParseLongNameAlias() { SwitchArgument argument = new SwitchArgument("switch", "", new[] { "Alias" }, null); int i = 1; var result = argument.Parse(new[] { "--switch1", "--alias" }, ref i); Assert.IsNotNull(result); Assert.AreEqual(2, i); }
public void ParseLongName1() { SwitchArgument argument = new SwitchArgument("switch", ""); Assert.IsFalse(string.IsNullOrEmpty(argument.GetSyntax())); Assert.IsTrue(string.IsNullOrEmpty(argument.GetHelp())); int i = 1; var result = argument.Parse(new[] { "--switch1", "--switch" }, ref i); Assert.IsNotNull(result); Assert.AreEqual(2, i); }