コード例 #1
0
 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);
 }
コード例 #2
0
 public void GetValue_instance_null_throws()
 {
     var runtimeDynamicType = new RuntimeDynamicType(typeof(TestClass));
     var result = runtimeDynamicType.GetValue(null, string.Empty);
     Assert.AreEqual(Undefined.Value, result);
 }
コード例 #3
0
 public void GetDynamicProperty_throwOnNotFound()
 {
     var runtimeDynamicType = new RuntimeDynamicType(typeof(TestClass));
     object instance = new TestClass();
     runtimeDynamicType.GetValue(instance, string.Empty);
 }