public void PropertyFilter_finds_declared_properties_on_derived_type()
        {
            var propertyNames = new[]
                {
                    "PublicDerived"
                };

            var properties = new PropertyFilter().GetProperties(
                typeof(PropertyFilterTests_Derived), true, Enumerable.Empty<PropertyInfo>());

            Assert.Equal(propertyNames.Length, properties.Count());
            Assert.True(properties.All(x => propertyNames.Contains(x.Name)));
        }
Exemplo n.º 2
0
        public void PropertyFilter_finds_declared_properties_on_derived_type()
        {
            var propertyNames = new[]
            {
                "PublicDerived"
            };

            var properties = new PropertyFilter().GetProperties(
                typeof(PropertyFilterTests_Derived), true, Enumerable.Empty <PropertyInfo>());

            Assert.Equal(propertyNames.Length, properties.Count());
            Assert.True(properties.All(x => propertyNames.Contains(x.Name)));
        }
        public void PropertyFilter_finds_all_properties_on_derived_type()
        {
            var propertyNames = new[]
                {
                    "PublicBase",
                    "PublicBaseForNew",
                    "PublicVirtualBase",
                    "PublicVirtualBase2",
                    "InterfaceImplicit",
                    "PublicDerived"
                };

            var properties = new PropertyFilter().GetProperties(
                typeof(PropertyFilterTests_Derived), false, Enumerable.Empty<PropertyInfo>());

            Assert.Equal(propertyNames.Length, properties.Count());
            Assert.True(properties.All(x => propertyNames.Contains(x.Name)));
        }
Exemplo n.º 4
0
        public void PropertyFilter_finds_all_properties_on_derived_type()
        {
            var propertyNames = new[]
            {
                "PublicBase",
                "PublicBaseForNew",
                "PublicVirtualBase",
                "PublicVirtualBase2",
                "InterfaceImplicit",
                "PublicDerived"
            };

            var properties = new PropertyFilter().GetProperties(
                typeof(PropertyFilterTests_Derived), false, Enumerable.Empty <PropertyInfo>());

            Assert.Equal(propertyNames.Length, properties.Count());
            Assert.True(properties.All(x => propertyNames.Contains(x.Name)));
        }