public void GetPropertyType_should_obtain_value_nominal() { var pp = new ReflectionPropertyProvider(new A()); Assert.Equal(typeof(string), pp.GetPropertyType("B")); Assert.Null(pp.GetPropertyType("Z")); }
public void TryGetProperty_should_filter_on_property_type() { var pp = new ReflectionPropertyProvider(new A()); object actual; Assert.False(pp.TryGetProperty("B", typeof(int), out actual)); }
public void TryGetProperty_should_apply_to_nulls() { var pp = new ReflectionPropertyProvider(new A()); object actual; Assert.True(pp.TryGetProperty("C", typeof(string), out actual)); Assert.Null(actual); }
public void TryGetProperty_should_filter_on_property_type_polymorphic() { var pp = new ReflectionPropertyProvider(new A()); object actual; Assert.True(pp.TryGetProperty("D", typeof(object), out actual)); Assert.True(pp.TryGetProperty("D", typeof(L), out actual)); Assert.True(pp.TryGetProperty("D", typeof(N), out actual)); Assert.False(pp.TryGetProperty("D", typeof(O), out actual)); }
public void ToString_calls_underlying_string() { var pp = new ReflectionPropertyProvider(new A()); Assert.Equal(new A().ToString(), pp.ToString()); }