Example #1
0
        public void PropertyFilter_includes_enum_and_spatial_properties_if_V3_features_are_supported()
        {
            var mockType = new MockType();

            mockType.Setup(m => m.IsEnum).Returns(true);

            var properties = new PropertyInfo[]
            {
                new MockPropertyInfo(typeof(DbGeography), "Geography"),
                new MockPropertyInfo(typeof(DbGeometry), "Geometry"),
                new MockPropertyInfo(mockType, "EnumProp")
            };

            mockType.Setup(m => m.GetProperties(It.IsAny <BindingFlags>())).Returns(properties);

            var filteredProperties = new PropertyFilter().GetProperties(mockType, declaredOnly: false);

            properties.All(p => filteredProperties.Select(f => f.Name).Contains(p.Name));
        }
        public void PropertyFilter_includes_enum_and_spatial_properties_if_V3_features_are_supported()
        {
            var mockType = new MockType();
            mockType.Setup(m => m.IsEnum).Returns(true);

            var properties = new PropertyInfo[]
            { 
                new MockPropertyInfo(typeof(DbGeography), "Geography"), 
                new MockPropertyInfo(typeof(DbGeometry), "Geometry"),
                new MockPropertyInfo(mockType, "EnumProp") 
            };

            mockType.Setup(m => m.GetProperties(It.IsAny<BindingFlags>())).Returns(properties);

            var filteredProperties = new PropertyFilter().GetProperties(mockType, declaredOnly: false);

            properties.All(p => filteredProperties.Select(f => f.Name).Contains(p.Name));
        }