public void InvokeMethodWithNonNullParametersViaReflection_PropagatesNullReferenceExceptionNullParameter() { var instance = new TestReflectionClass1(); ExceptionAssert.Propagates <NullReferenceException>(() => instance.InvokeMethodWithNonNullParametersViaReflection("PublicMethodWithIntParameter", new object[] { null })); }
public void InvokeMethodWithNonNullParametersViaReflection_IsResult() { var instance = new TestReflectionClass1(); var result = instance.InvokeMethodWithNonNullParametersViaReflection("PublicMethodWithIntParameter", 99); Assert.AreEqual(99, result); }
public void InvokeMethodWithNonNullParametersViaReflection_CallsMethod() { var instance = new TestReflectionClass1(); instance.InvokeMethodWithNonNullParametersViaReflection("PublicParameterlessMethod"); Assert.IsTrue(instance.PublicParameterlessMethodCalled); }
public void InvokeMethodWithNonNullParametersViaReflection_PassesParameters() { var instance = new TestReflectionClass1(); instance.InvokeMethodWithNonNullParametersViaReflection("PublicMethodWithIntParameter", 88); Assert.AreEqual(88, instance.PublicMethodWithIntParameterData); }
public void InvokeMethodViaReflection_WithoutTypes_PassesParameters() { var instance = new TestReflectionClass1(); instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", 66); Assert.AreEqual(66, instance.PublicMethodWithIntParameterData); }
public void InvokeMethodViaReflection_WithoutTypes_IsResult() { var instance = new TestReflectionClass1(); var result = instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", 77); Assert.AreEqual(77, result); }
public void InvokeMethodViaReflection_WithTypes_PassesParameters() { var instance = new TestReflectionClass1(); instance.InvokeMethodViaReflection("PublicMethodWithIntParameter", new[] { typeof(int) }, new object[] { 101 }); Assert.AreEqual(101, 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 WriteViaReflection_SetsPropertyValue() { var instance = new TestReflectionClass1(); instance.WriteViaReflection("PublicProperty", 28); Assert.AreEqual(28, instance.PublicProperty); }
public void InvokeMethodViaReflection_WithTypes_CallsMethod() { var instance = new TestReflectionClass1(); instance.InvokeMethodViaReflection("PublicParameterlessMethod", new Type[0], new object[0]); Assert.IsTrue(instance.PublicParameterlessMethodCalled); }
public void WriteViaReflection_SetsFieldValue() { var instance = new TestReflectionClass1(); instance.WriteViaReflection("PublicField", 18); Assert.AreEqual(18, instance.PublicField); }
public void WriteIndexerViaReflection_SetsIndexerValue() { var instance = new TestReflectionClass1(); instance.IndexedValue = new int[1]; instance.WriteIndexerViaReflection(8, 0); Assert.AreEqual(8, instance[0]); }
public void ReadIndexeViaReflectionr_IsIndexerValue() { var instance = new TestReflectionClass1(); instance.IndexedValue = new int[1]; instance[0] = 101; Assert.AreEqual(101, instance.ReadIndexerViaReflection(0)); }
public void ReadViaReflection_IsPropertyValue() { var instance = new TestReflectionClass1 { PublicProperty = 6 }; Assert.AreEqual(6, instance.ReadViaReflection("PublicProperty")); }
public void ReadViaReflection_IsFieldValue() { var instance = new TestReflectionClass1 { PublicField = 5 }; Assert.AreEqual(5, instance.ReadViaReflection("PublicField")); }