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); }
public void GetProperty_NotMemberExpression() { // Act ExpressionExtensions.GetProperty <string, string>(s => s); }
public void GetProperty_NotPropertyInfo() { // Act ExpressionExtensions.GetProperty <SimplePoco, string>(s => s.MyStringField); }
public void GetProperty_NoExpressionProvided() { // Act ExpressionExtensions.GetProperty((Expression <Func <string, string> >)null); }