Exemplo n.º 1
0
 public void Test_CallFunction_ReturnString()
 {
     // Test a function that returns a string
     LuaUtilities.LoadScriptFromFile(testCode1Path);
     MoonSharp.Interpreter.DynValue value = LuaUtilities.CallFunction("test_func1");
     Assert.AreEqual("test_func1_returns", value.CastToString());
 }
Exemplo n.º 2
0
 public void Test_CallFunction_InputString_ReturnInput()
 {
     // Test a function that returns the String passed to it
     LuaUtilities.LoadScriptFromFile(testCode1Path);
     MoonSharp.Interpreter.DynValue value = LuaUtilities.CallFunction("test_func2", "inputted value");
     Assert.AreEqual("inputted value", value.CastToString());
 }