GetScriptString() public static method

Gets a script from the assembly.
public static GetScriptString ( string name ) : String
name string /// The name of the script. ///
return String
Esempio n. 1
0
        public void Ensure_That_Remoting_Works()
        {
            using (Lua remoting1 = new Lua( ))
                using (Lua remoting2 = new Lua( ))
                {
                    remoting1["remote"] = RemoteFunction.Instance;

                    LookupTable <string, Lua> .Store("TestRemoting1", remoting1);

                    LookupTable <string, Lua> .Store("TestRemoting2", remoting2);

                    remoting1.DoString(LuaScripts.GetScriptString("TestRemoting1"));
                    remoting2.DoString(LuaScripts.GetScriptString("TestRemoting2"));

                    AssertOutput(remoting2, "Execute", "TestRemoting1: Value 2\nValue 1");
                }
        }
Esempio n. 2
0
        public void Ensure_That_CLR_Errors_Are_Received( )
        {
            using (Lua err = new Lua( ))
            {
                err["throwClrException"] = ThrowClrException.Instance;
                err.DoString(LuaScripts.GetScriptString("TestExecution"));

                try
                {
                    ((LuaFunction)err["ExecuteClr"]).Call( );
                    Assert.Fail("Test CLR Errors: error not received.");
                }
                catch
                {
                    // Assert.Pass
                }
            }
        }
Esempio n. 3
0
 public void Ensure_That_A_Basic_Script_Runs()
 {
     AssertOutput(LuaScripts.GetScriptString("TestExecution"), "Execute", "Executed", "Basic execution.");
 }
Esempio n. 4
0
 public void TestExecution()
 {
     AssertOutput(LuaScripts.GetScriptString("TestExecution"), "Execute", "Executed", "Basic execution.");
 }