Example #1
0
        public void Aliases()
        {
            var program = new Program {
                Application = "test"
            };

            program.Run("alias std show --code 153 --amount 153.69 --attribute-targets all --text 'foo' --recursive", "--", " ");
            program.Run("std", "--", " ");

            Console.WriteLine();

            var objectProgram = new ObjectProgram {
                Application = "test.object"
            };

            objectProgram.Run("alias std show --code 153 --amount 153.69 --attribute-targets all --text 'foo' --recursive", "--", " ");
            objectProgram.Run("std", "--", " ");

            Console.WriteLine();

            var thisProgram = new ThisProgram {
                Application = "test.this"
            };

            thisProgram.Run("alias std show --code 153 --amount 153.69 --attribute-targets all --text 'foo' --recursive", "--", " ");
            thisProgram.Run("std", "--", " ");
        }
Example #2
0
        public void RunTest()
        {
            var program = new Program();

            program.Run("foo.exe pull /code: 153 /amount: 153.69 /attribute-targets: all /array: [a, b, c]", "/", ":");

            Console.WriteLine();

            var objectProgram = new ObjectProgram();

            objectProgram.Run("foo.exe pull /code: 153 /amount: 153.69 /attribute-targets: all /array: [a, b, c]", "/", ":");

            Console.WriteLine();

            var thisProgram = new ThisProgram();

            thisProgram.Run("foo.exe pull /code: 153 /amount: 153.69 /attribute-targets: all /array: [a, b, c]", "/", ":");
        }
Example #3
0
        public void AlternateSyntax()
        {
            var program = new Program();

            program.Run("show --code 153 --amount 153.69 --attribute-targets all --text 'foo' --recursive- --array [a,b,c]", "--", " ");

            Console.WriteLine();

            var objectProgram = new ObjectProgram();

            objectProgram.Run("show --code 153 --amount 153.69 --attribute-targets all --text 'foo' --recursive- --array [a,b,c]", "--", " ");

            Console.WriteLine();

            var thisProgram = new ThisProgram {
                Shortcuts = "C = code; A = amount; R = recursive; a = array"
            };

            thisProgram.Run("show -C 153 -A 153.69 --attribute-targets all --text 'foo' -R -a [a, b, c]", "--", " ");
        }
Example #4
0
        public void GreedyTest()
        {
            var program = new Program();

            program.Run("\"foo.exe\" push /code: 153 /amount: 153.69 /attribute-targets: all /text: 'foo' /recursive: false /array: [a, b, c]", "/",
                        ":");

            Console.WriteLine();

            var objectProgram = new ObjectProgram();

            objectProgram.Run("\"foo.exe\" push /code: 153 /amount: 153.69 /attribute-targets: all /text: 'foo' /recursive: false /array: [a, b, c]",
                              "/", ":");

            Console.WriteLine();

            var thisProgram = new ThisProgram();

            thisProgram.Run("\"foo.exe\" push /code: 153 /amount: 153.69 /attribute-targets: all /text: 'foo' /recursive: false /array: [a, b, c]", "/",
                            ":");
        }