public void PropertyHelper_ReturnsValueCorrectly_ForValueTypes() { // Arrange var anonymous = new { foo = 32 }; var property = PropertyHelper.GetPropertyAccessors(anonymous.GetType()).First().Property; // Act var helper = new PropertyHelper.PropertyAccessor(property); // Assert Assert2.Equal("foo", helper.Name); Assert2.Equal(32, helper.GetValue(anonymous)); }
public void PropertyHelper_ReturnsValueCorrectly() { // Arrange var anonymous = new { bar = "baz" }; var property = PropertyHelper.GetPropertyAccessors(anonymous.GetType()).First().Property; // Act var helper = new PropertyHelper.PropertyAccessor(property); // Assert Assert2.Equal("bar", helper.Name); Assert2.Equal("baz", helper.GetValue(anonymous)); }