コード例 #1
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)));
        }
コード例 #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)));
        }
コード例 #3
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)));
        }
コード例 #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)));
        }