public void GetValue_instance_not_null() { var runtimeDynamicType = new RuntimeDynamicType(typeof(TestClass)); var instance = new TestClass { Name = "noName" }; var result = runtimeDynamicType.GetValue(instance, "Name"); Assert.AreEqual(instance.Name, result); }
public void GetValue_instance_null_throws() { var runtimeDynamicType = new RuntimeDynamicType(typeof(TestClass)); var result = runtimeDynamicType.GetValue(null, string.Empty); Assert.AreEqual(Undefined.Value, result); }
public void GetDynamicProperty_throwOnNotFound() { var runtimeDynamicType = new RuntimeDynamicType(typeof(TestClass)); object instance = new TestClass(); runtimeDynamicType.GetValue(instance, string.Empty); }