Ejemplo n.º 1
0
        public void InvokeMethodViaReflection_WithoutTypes_IsResult()
        {
            var instance = new TestReflectionClass1();
            var result   = instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", 77);

            Assert.AreEqual(77, result);
        }
Ejemplo n.º 2
0
        public void InvokeMethodViaReflection_WithoutTypes_PassesParameters()
        {
            var instance = new TestReflectionClass1();

            instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", 66);
            Assert.AreEqual(66, instance.PublicMethodWithIntParameterData);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
        public void InvokeMethodViaReflection_WithoutTypes_CallsMethod()
        {
            var instance = new TestReflectionClass1();

            instance.InvokeMethodViaReflection("PublicParameterlessMethod");
            Assert.IsTrue(instance.PublicParameterlessMethodCalled);
        }
Ejemplo n.º 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);
        }