public void TestBoolEx() { Lunar.RegisterCommandEx("action", (bool[] args) => { AddResult("action " + StringUtils.Join(args, " ")); return true; }); Execute("action"); AssertResult("action "); }
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"); }
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"); }
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"); }
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"); }
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)"); }
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"); }
public void TestStringArgEx() { Lunar.RegisterCommandEx("action", (string arg) => { AddResult("action " + arg); return(true); }); Execute("action arg1"); AssertResult("action arg1"); }
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"); }
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"); }
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"); }
public void TestIntArgEx() { Lunar.RegisterCommandEx("action", (int arg) => { AddResult("action " + arg); return(true); }); Execute("action 10"); AssertResult("action 10"); }
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"); }
public void TestBoolArgEx() { Lunar.RegisterCommandEx("action", (bool arg) => { AddResult("action " + arg); return(true); }); Execute("action 1"); AssertResult("action True"); }
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"); }