示例#1
0
        public void InvokeMethodViaReflection_WithoutTypes_IsResult()
        {
            var instance = new TestReflectionClass1();
            var result   = instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", 77);

            Assert.AreEqual(77, result);
        }
示例#2
0
        public void InvokeMethodViaReflection_WithoutTypes_PassesParameters()
        {
            var instance = new TestReflectionClass1();

            instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", 66);
            Assert.AreEqual(66, instance.PublicMethodWithIntParameterData);
        }
示例#3
0
        public void InvokeMethodViaReflection_WithTypes_IsResult()
        {
            var instance = new TestReflectionClass1();
            var result   = instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", new[] { typeof(int) }, new object[] { 45 });

            Assert.AreEqual(45, result);
        }
示例#4
0
        public void InvokeMethodViaReflection_WithoutTypes_CallsMethod()
        {
            var instance = new TestReflectionClass1();

            instance.InvokeMethodViaReflection("PublicParameterlessMethod");
            Assert.IsTrue(instance.PublicParameterlessMethodCalled);
        }
示例#5
0
        public void InvokeMethodViaReflection_WithTypes_PassesParameters()
        {
            var instance = new TestReflectionClass1();

            instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", new[] { typeof(int) }, new object[] { 101 });
            Assert.AreEqual(101, instance.PublicMethodWithIntParameterData);
        }