public void TestPropertyMarshalling()
        {
            ScriptEngine           engine  = new ScriptEngine();
            TestPropertyMarshalObj testObj = new TestPropertyMarshalObj(engine.Object.Prototype, 10);

            engine.SetGlobalValue("TestObject", testObj);
            Assert.AreEqual(10, engine.Evaluate <int>("TestObject.Value2"));
            engine.Execute("TestObject.Value = 5;");
            Assert.AreEqual(5, engine.Evaluate <int>("TestObject.Value"));
            Assert.AreEqual("5; 10", engine.Evaluate <string>("TestObject.toString()"));
        }
示例#2
0
 public void TestPropertyMarshalling()
 {
     ScriptEngine engine = new ScriptEngine();
     TestPropertyMarshalObj testObj = new TestPropertyMarshalObj(engine.Object.Prototype, 10);
     engine.SetGlobalValue("TestObject", testObj);
     Assert.AreEqual(10, engine.Evaluate<int>("TestObject.Value2"));
     engine.Execute("TestObject.Value = 5;");
     Assert.AreEqual(5, engine.Evaluate<int>("TestObject.Value"));
     Assert.AreEqual("5; 10", engine.Evaluate<string>("TestObject.toString()"));
 }