public void StructInstance_StructField_Get_Test() { var fakes = new StructFieldFakes(); fakes.StructField = 100; var field = typeof(StructFieldFakes).GetTypeInfo().GetField("StructField"); var fieldReflector = field.GetReflector(); var fieldValue = fieldReflector.GetValue(fakes); Assert.Equal(100, fieldValue); }
public void StructInstance_Field_Get_Test() { var fakes = new StructFieldFakes(); fakes.ClassField = "Lemon"; var field = typeof(StructFieldFakes).GetTypeInfo().GetField("ClassField"); var fieldReflector = field.GetReflector(); var fieldValue = fieldReflector.GetValue(fakes); Assert.Equal("Lemon", fieldValue); }