GetArguments() 공개 메소드

public GetArguments ( ) : string[]
리턴 string[]
예제 #1
0
        public void GetArguments() {
            string[] arguments = new string[]
                                 {
                                     "--help", "-d", "doc.xml",
                                     "/pet:cat"
                                 };
            ArgvConfigSource source = new ArgvConfigSource(arguments);

            source.AddSwitch("Base", "help", "h");
            source.AddSwitch("Base", "doc", "d");
            source.AddSwitch("Base", "short");

            string[] args = source.GetArguments();
            Assert.IsTrue(args != arguments); // must be a different instance
            Assert.AreEqual(4, args.Length);
            Assert.AreEqual("--help", args[0]);
            Assert.AreEqual("-d", args[1]);
            Assert.AreEqual("doc.xml", args[2]);
            Assert.AreEqual("/pet:cat", args[3]);
        }
예제 #2
0
        public void GetArguments()
        {
            string[] arguments = new string[]
            {
                "--help", "-d", "doc.xml",
                "/pet:cat"
            };
            ArgvConfigSource source = new ArgvConfigSource(arguments);

            source.AddSwitch("Base", "help", "h");
            source.AddSwitch("Base", "doc", "d");
            source.AddSwitch("Base", "short");

            string[] args = source.GetArguments();
            Assert.IsTrue(args != arguments); // must be a different instance
            Assert.AreEqual(4, args.Length);
            Assert.AreEqual("--help", args[0]);
            Assert.AreEqual("-d", args[1]);
            Assert.AreEqual("doc.xml", args[2]);
            Assert.AreEqual("/pet:cat", args[3]);
        }