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"));
 }
示例#2
0
        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"));
        }
示例#3
0
        public void WithTwoDash()
        {
            CommandLineParser parser = new CommandLineParser(typeof(CommandLineArgs),
                                                             new string[] { "--Server", "TestServer" });

            Assert.AreEqual("TestServer", parser.GetArgumentValue("Server"));
        }
示例#4
0
        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"));
 }