public void Test8()
        {
            var args = ConsoleInputParser.Parse(@"""    aaaa    """);

            Assert.True(args.Length == 1);
            Assert.True(args[0] == @"    aaaa    ");
        }
        public void Test10()
        {
            var args = ConsoleInputParser.Parse(@"sdjkas'asdsakl""asdas""'");

            Assert.True(args.Length == 1);
            Assert.True(args[0] == @"sdjkasasdsakl""asdas""");
        }
        public void Test2()
        {
            var args = ConsoleInputParser.Parse(@"'asds'");

            Assert.True(args.Length == 1);
            Assert.True(args[0] == @"asds");
        }
        public void Test4()
        {
            var args = ConsoleInputParser.Parse(@" a a ");

            Assert.True(args.Length == 2);
            Assert.True(args[0] == @"a");
            Assert.True(args[1] == @"a");
        }
        public void Test14()
        {
            var args = ConsoleInputParser.Parse(@"abc'defg \' 'hi 123 ""456 678\""quote\"""" ");

            Assert.True(args.Length == 3);
            Assert.True(args[0] == @"abcdefg ' hi");
            Assert.True(args[1] == @"123");
            Assert.True(args[2] == "456 678\"quote\"");
        }
        public void Test13()
        {
            var args = ConsoleInputParser.Parse(@"     ");

            Assert.True(args.Length == 0);
        }
Beispiel #7
0
 /// <summary>
 /// Parse using a internal class that simule the a simple prompt parse
 /// </summary>
 /// <param name="commandLine">Command line text</param>
 /// <returns>Arguments parseds</returns>
 public static string[] CommandLineToArgs(string commandLine)
 {
     return(ConsoleInputParser.Parse(commandLine));
 }