public void CheckBoolProp() { TestClass testClass = new TestClass(); testClass.BoolProp = true; string jsScript = "return DataObject.BoolProp;"; CsharpScriptingEngine scriptingEngine = new CsharpScriptingEngine(jsScript); scriptingEngine.Execute <bool>(testClass).ShouldBeTrue(); testClass.BoolProp = false; scriptingEngine.Execute <bool>(testClass).ShouldBeFalse(); }
public int Csharp() { int a = 0; for (int i = 0; i < Size; i++) { var b = _csharpScriptingEngine.Execute <bool>(_testClasses[i]); a += b ? 1 : 0; } return(a); }