public void Test4() { var se = new ScriptingEngine(); var s = se.Exec("var x = 1;"); Console.WriteLine("Running ScriptingTests.Test4 :: '" + s + "'"); s = se.Exec("return x == 1 ? 2 : 0;"); Assert.Equal("2", s); }
public void Test5() { Dictionary <string, object> globals = new Dictionary <string, object>() { { "animal", "dog" }, { "place", "Istanbul" }, { "Happy", "HappyFlip" }, { "prep", "then" }, { "i", 0 } }; var se = new ScriptingEngine(globals); var s = se.Exec("var x = 1;"); Console.WriteLine("Running ScriptingTests.Test3 :: '" + s + "'"); s = se.Exec("return x == 1 ? 2 : 0;"); Assert.Equal("2", s); }