public void InvokeMethodViaReflection_WithoutTypes_IsResult() { var instance = new TestReflectionClass1(); var result = instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", 77); Assert.AreEqual(77, result); }
public void InvokeMethodViaReflection_WithoutTypes_PassesParameters() { var instance = new TestReflectionClass1(); instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", 66); Assert.AreEqual(66, instance.PublicMethodWithIntParameterData); }
public void InvokeMethodViaReflection_WithTypes_IsResult() { var instance = new TestReflectionClass1(); var result = instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", new[] { typeof(int) }, new object[] { 45 }); Assert.AreEqual(45, result); }
public void InvokeMethodViaReflection_WithoutTypes_CallsMethod() { var instance = new TestReflectionClass1(); instance.InvokeMethodViaReflection("PublicParameterlessMethod"); Assert.IsTrue(instance.PublicParameterlessMethodCalled); }
public void InvokeMethodViaReflection_WithTypes_PassesParameters() { var instance = new TestReflectionClass1(); instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", new[] { typeof(int) }, new object[] { 101 }); Assert.AreEqual(101, instance.PublicMethodWithIntParameterData); }