コード例 #1
0
 public void SetValue_valid_instance()
 {
     var runtimeDynamicType = new RuntimeDynamicType(typeof(TestClass));
     var instance = new TestClass();
     const string value = "someName";
     runtimeDynamicType.SetValue(instance, "Name", value);
     Assert.AreEqual(value, instance.Name);
 }
コード例 #2
0
 public void SetValue_instance_null_throws()
 {
     var runtimeDynamicType = new RuntimeDynamicType(typeof(TestClass));
     runtimeDynamicType.SetValue(null, string.Empty, null);
 }