Пример #1
0
        public void CanGetStaticPropertyValue()
        {
            // Arrange
            var propertyName = ClassWithPrivateFields.StaticPropertyName;

            // Act
            var value = FieldPropertyRead.StaticValue <ClassWithPrivateFields>(propertyName);

            // Assert
            Assert.Equal(ClassWithPrivateFields.DirectStaticProperty, value);
        }
Пример #2
0
        public void CanGetInstancePropertyValue()
        {
            // Arrange
            var propertyName = ClassWithPrivateFields.InstancePropertyName;

            // Act
            var value = FieldPropertyRead.Value(target, propertyName);

            // Assert
            Assert.Equal(target.DirectInstanceProperty, value);
        }
Пример #3
0
 public R ToGet <R>(string memberName)
 {
     return((R)FieldPropertyRead.Value(@object, memberName));
 }
Пример #4
0
 public R ToGet <R>(string memberName)
 {
     return((R)FieldPropertyRead.StaticValue <T>(memberName));
 }