public void Struct_InstanceProperty_Get_Test() { var fakes = new StructPropertyFakes(); fakes.InstanceProperty = "InstanceProperty"; var Property = typeof(StructPropertyFakes).GetTypeInfo().GetProperty("InstanceProperty"); var PropertyReflector = Property.GetReflector(); var PropertyValue = PropertyReflector.GetValue(fakes); Assert.Equal("InstanceProperty", PropertyValue); }
public void Struct_InstanceProperty_Set_Test() { var fakes = new StructPropertyFakes(); var Property = typeof(StructPropertyFakes).GetTypeInfo().GetProperty("InstanceProperty"); var PropertyReflector = Property.GetReflector(); PropertyReflector.SetValue(fakes, "InstanceProperty"); Assert.Null(fakes.InstanceProperty); //object obj = fakes; //PropertyReflector.SetValue(obj, "InstanceProperty"); //Assert.Equal("InstanceProperty", ((StructPropertyFakes)obj).InstanceProperty); }