Beispiel #1
0
        public void TestExactConstructor()
        {
            var refObj = new Reflector(NSName + ".NewInstanceTarget", typeof(IndexerTestTarget));
            var obj    = refObj.NewInstanceExact(ReflectorParam.New <string>(null));

            Assert.IsTrue((bool)refObj.GetField(obj, "isNullTextReceived"));
        }
Beispiel #2
0
        public void TestConstructorWithRefParam()
        {
            var refObj = new Reflector(NSName + ".NewInstanceTarget", typeof(IndexerTestTarget));

            var pm  = ReflectorParam.New(0, true);
            var obj = refObj.NewInstanceExact(pm);

            Assert.AreEqual(123, pm.Value);
        }
Beispiel #3
0
        public void TestMethodWithOutParam()
        {
            var reflector = new Reflector(typeof(MethodTestTarget));

            var obj = new MethodTestTarget(-3);

            var outParam = ReflectorParam.New(0, true);

            reflector.InvokeExact(obj, "Sum", ReflectorParam.New(4), outParam);

            Assert.AreEqual(1, outParam.Value);
        }