public int NLua() { int a = 0; for (int i = 0; i < Size; i++) { var b = _luaScriptingEngine.Execute <bool>(_testClasses[i]); a += b ? 1 : 0; } return(a); }
public void CheckBoolProp() { TestClass testClass = new TestClass(); testClass.BoolProp = true; string luaScript = "res = dataObject.BoolProp"; LuaScriptingEngine luaScriptingEngine = new LuaScriptingEngine(luaScript); luaScriptingEngine.Execute <bool>(testClass).ShouldBeTrue(); testClass.BoolProp = false; luaScriptingEngine.Execute <bool>(testClass).ShouldBeFalse(); }