public void CanGetStaticPropertyValue() { // Arrange var propertyName = ClassWithPrivateFields.StaticPropertyName; // Act var value = FieldPropertyRead.StaticValue <ClassWithPrivateFields>(propertyName); // Assert Assert.Equal(ClassWithPrivateFields.DirectStaticProperty, value); }
public void CanGetInstancePropertyValue() { // Arrange var propertyName = ClassWithPrivateFields.InstancePropertyName; // Act var value = FieldPropertyRead.Value(target, propertyName); // Assert Assert.Equal(target.DirectInstanceProperty, value); }
public R ToGet <R>(string memberName) { return((R)FieldPropertyRead.Value(@object, memberName)); }
public R ToGet <R>(string memberName) { return((R)FieldPropertyRead.StaticValue <T>(memberName)); }