Пример #1
0
        public void GetProperty()
        {
            // Assert
            var expected = typeof(SimplePoco).GetProperty(nameof(SimplePoco.MyStringProperty));

            // Act
            var actual = ExpressionExtensions.GetProperty <SimplePoco, string>(s => s.MyStringProperty);

            // Assert
            actual.ShouldHaveSameValueAs(expected);
        }
Пример #2
0
 public void GetProperty_NotMemberExpression()
 {
     // Act
     ExpressionExtensions.GetProperty <string, string>(s => s);
 }
Пример #3
0
 public void GetProperty_NotPropertyInfo()
 {
     // Act
     ExpressionExtensions.GetProperty <SimplePoco, string>(s => s.MyStringField);
 }
Пример #4
0
 public void GetProperty_NoExpressionProvided()
 {
     // Act
     ExpressionExtensions.GetProperty((Expression <Func <string, string> >)null);
 }