public void TestBoolEx()
        {
            Lunar.RegisterCommandEx("action", (bool[] args) =>
            {
                AddResult("action " + StringUtils.Join(args, " "));
                return true;
            });

            Execute("action");
            AssertResult("action ");
        }
Exemplo n.º 2
0
        public void TestFloatArg3Ex()
        {
            Lunar.RegisterCommandEx("action", (float arg1, float arg2, float arg3) =>
            {
                AddResult("action " + arg1 + " " + arg2 + " " + arg3);
                return(true);
            });

            Execute("action 3.14 3.15 3.16");
            AssertResult("action 3.14 3.15 3.16");
        }
        public void TestBoolArg2Ex()
        {
            Lunar.RegisterCommandEx("action", (bool arg1, bool arg2) =>
            {
                AddResult("action " + arg1 + " " + arg2);
                return true;
            });

            Execute("action 1 0");
            AssertResult("action True False");
        }
Exemplo n.º 4
0
        public void TestBool3Ex()
        {
            Lunar.RegisterCommandEx("action", (bool[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action 1 0 1");
            AssertResult("action True False True");
        }
Exemplo n.º 5
0
        public void TestInts3Ex()
        {
            Lunar.RegisterCommandEx("action", (int[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action 10 20 30");
            AssertResult("action 10 20 30");
        }
Exemplo n.º 6
0
        public void TestFloat3Ex()
        {
            Lunar.RegisterCommandEx("action", (float[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action 3.14 3.15 3.16");
            AssertResult("action 3.14 3.15 3.16");
        }
Exemplo n.º 7
0
        public void TestVector4Ex()
        {
            Lunar.RegisterCommandEx("action", (Vector4 arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action 1.0 2.0 3.0 4.0");
            AssertResult("action (1.0, 2.0, 3.0, 4.0)");
        }
Exemplo n.º 8
0
        public void TestStrings3Ex()
        {
            Lunar.RegisterCommandEx("action", (string[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action arg1 arg2 arg3");
            AssertResult("action arg1 arg2 arg3");
        }
Exemplo n.º 9
0
        public void TestStringArgEx()
        {
            Lunar.RegisterCommandEx("action", (string arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action arg1");
            AssertResult("action arg1");
        }
Exemplo n.º 10
0
        public void TestStringArg3Ex()
        {
            Lunar.RegisterCommandEx("action", (string arg1, string arg2, string arg3) =>
            {
                AddResult("action " + arg1 + " " + arg2 + " " + arg3);
                return(true);
            });

            Execute("action arg1 arg2 arg3");
            AssertResult("action arg1 arg2 arg3");
        }
Exemplo n.º 11
0
        public void TestFloatArgEx()
        {
            Lunar.RegisterCommandEx("action", (float arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action 3.14");
            AssertResult("action 3.14");
        }
        public void TestFloatArg2Ex()
        {
            Lunar.RegisterCommandEx("action", (float arg1, float arg2) =>
            {
                AddResult("action " + arg1 + " " + arg2);
                return true;
            });

            Execute("action 3.14 3.15");
            AssertResult("action 3.14 3.15");
        }
Exemplo n.º 13
0
        public void TestIntArg3Ex()
        {
            Lunar.RegisterCommandEx("action", (int arg1, int arg2, int arg3) =>
            {
                AddResult("action " + arg1 + " " + arg2 + " " + arg3);
                return(true);
            });

            Execute("action 10 20 30");
            AssertResult("action 10 20 30");
        }
Exemplo n.º 14
0
        public void TestIntArgEx()
        {
            Lunar.RegisterCommandEx("action", (int arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action 10");
            AssertResult("action 10");
        }
Exemplo n.º 15
0
        public void TestBoolArg3Ex()
        {
            Lunar.RegisterCommandEx("action", (bool arg1, bool arg2, bool arg3) =>
            {
                AddResult("action " + arg1 + " " + arg2 + " " + arg3);
                return(true);
            });

            Execute("action 1 0 1");
            AssertResult("action True False True");
        }
Exemplo n.º 16
0
        public void TestBoolArgEx()
        {
            Lunar.RegisterCommandEx("action", (bool arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action 1");
            AssertResult("action True");
        }
Exemplo n.º 17
0
        public void TestFunctionChain()
        {
            Lunar.RegisterCommandEx("action1", () =>
            {
                AddResult("action1");
                return(true);
            });

            Lunar.RegisterCommandEx("action2", () =>
            {
                AddResult("action2");
                return(true);
            });

            Execute("action1 && action2");
            AssertResult("action1", "action2");
        }
        public void TestFunctionBrokenChain()
        {
            Lunar.RegisterCommandEx("action1", () =>
            {
                AddResult("action1");
                return true;
            });

            Lunar.RegisterCommandEx("action2", () =>
            {
                AddResult("action2");
                return false;
            });

            Lunar.RegisterCommandEx("action3", () =>
            {
                AddResult("action3");
                return false;
            });

            Execute("action1 && action2 && action3", false);
            AssertResult("action1", "action2");
        }