public void GetArgumentValue() { CommandLineParser parser = new CommandLineParser(typeof(CommandLineArgs), new string[] {"/OtherOption", "Database", "/Database", "TestDb", "-Server", "TestServer"}); Assert.AreEqual("TestDb", parser.GetArgumentValue("Database")); Assert.AreEqual("TestServer", parser.GetArgumentValue("Server")); Assert.AreEqual("Database", parser.GetArgumentValue("OtherOption")); }
public void GetArgumentValue() { CommandLineParser parser = new CommandLineParser(typeof(CommandLineArgs), new string[] { "/OtherOption", "Database", "/Database", "TestDb", "-Server", "TestServer" }); Assert.AreEqual("TestDb", parser.GetArgumentValue("Database")); Assert.AreEqual("TestServer", parser.GetArgumentValue("Server")); Assert.AreEqual("Database", parser.GetArgumentValue("OtherOption")); }
public void WithTwoDash() { CommandLineParser parser = new CommandLineParser(typeof(CommandLineArgs), new string[] { "--Server", "TestServer" }); Assert.AreEqual("TestServer", parser.GetArgumentValue("Server")); }
public void ColonSeparated() { CommandLineParser parser = new CommandLineParser(typeof(CommandLineArgs), new string[] { "-server:TestServer" }); Assert.AreEqual("TestServer", parser.GetArgumentValue("Server")); }
public void ColonSeparated() { CommandLineParser parser = new CommandLineParser(typeof(CommandLineArgs), new string[] {"-server:TestServer"}); Assert.AreEqual("TestServer", parser.GetArgumentValue("Server")); }
public void WithTwoDash() { CommandLineParser parser = new CommandLineParser(typeof(CommandLineArgs), new string[] {"--Server", "TestServer"}); Assert.AreEqual("TestServer", parser.GetArgumentValue("Server")); }