6bee/aqua-core

When_resolving_hidden_property.ResolveProperty_should_return_original_property_info

azabluda opened this issue · 0 comments

Version 4.5.0.

The following test fails with System.Reflection.AmbiguousMatchException

public class When_resolving_hidden_property
{
    private class TypeHidingBase
    {
        public string Property { get; }
    }

    private class TypeHiding : TypeHidingBase
    {
        public new int Property { get; }
    }

    [Fact]
    public void ResolveProperty_should_return_original_property_info()
    {
        var typeResolver = new TypeResolver();

        System.Reflection.TypeInfo type = typeof(TypeHiding).GetTypeInfo();
        System.Reflection.PropertyInfo propertyInfo = type.GetDeclaredProperty(nameof(TypeHiding.Property));
        Aqua.TypeSystem.PropertyInfo mappedProperty = new Aqua.TypeSystem.PropertyInfo(propertyInfo);
        System.Reflection.PropertyInfo resolvedProperty = mappedProperty.ResolveProperty(typeResolver);

        resolvedProperty.ShouldBe(propertyInfo);
    }
}