Esempio n. 1
0
        public void StaticMemberAccess_BindTestMethod_Interface()
        {
            var arg = new TestArg() as ITestArg;

            engine.AddRestrictedHostObject("arg", arg);
            Assert.AreEqual(StaticTestClass.StaticBindTestMethod(arg), engine.Evaluate("StaticTestClass.StaticBindTestMethod(arg)"));
        }
Esempio n. 2
0
 public void StaticMemberAccess_Event()
 {
     engine.Execute("var connection = StaticTestClass.StaticEvent.connect(function (sender, args) { host.type(sender).StaticScalarProperty = args.Arg; })");
     StaticTestClass.StaticFireEvent(5432);
     Assert.AreEqual(5432, StaticTestClass.StaticScalarProperty);
     engine.Execute("connection.disconnect()");
     StaticTestClass.StaticFireEvent(2345);
     Assert.AreEqual(5432, StaticTestClass.StaticScalarProperty);
 }
Esempio n. 3
0
 public void StaticMemberAccess_Method_GenericExplicit()
 {
     Assert.AreEqual(StaticTestClass.StaticMethod <TestEnum>(4), engine.Evaluate("StaticTestClass.StaticMethod(TestEnum, 4)"));
 }
Esempio n. 4
0
 public void StaticMemberAccess_Method_GenericRedundant()
 {
     Assert.AreEqual(StaticTestClass.StaticMethod("foo", 4, TestEnum.Second), engine.Evaluate("StaticTestClass.StaticMethod(TestEnum, 'foo', 4, TestEnum.Second)"));
 }
Esempio n. 5
0
 public void StaticMemberAccess_Method()
 {
     Assert.AreEqual(StaticTestClass.StaticMethod("foo", 4), engine.Evaluate("StaticTestClass.StaticMethod('foo', 4)"));
 }