public void AttributeCollectionFactory_returns_correct_set_of_empty_property_attributes()
        {
            var attributes = new AttributeProvider()
                             .GetAttributes(typeof(AttributeProviderTestEmptyClass).GetProperty("MyProp"));

            Assert.Equal(0, attributes.Count());
        }
        public void AttributeCollectionFactory_returns_correct_set_of_empty_property_attributes()
        {
            var attributes = new AttributeProvider()
                .GetAttributes(typeof(AttributeProviderTestEmptyClass).GetProperty("MyProp"));

            Assert.Equal(0, attributes.Count());
        }
        public void AttributeCollectionFactory_returns_only_property_attributes_for_complex_type()
        {
            var attributes = new AttributeProvider()
                .GetAttributes(typeof(AttributeProviderEntityWithComplexProperty).GetProperty("CT"));

            Assert.Equal(1, attributes.Count());
            Assert.Equal(typeof(AttributeProviderEntityWithComplexProperty), ((CustomValidationAttribute)attributes.First()).ValidatorType);
            Assert.Equal("ValidateProperty", ((CustomValidationAttribute)attributes.First()).Method);
        }
        public void AttributeCollectionFactory_returns_only_property_attributes_for_complex_type()
        {
            var attributes = new AttributeProvider()
                             .GetAttributes(typeof(AttributeProviderEntityWithComplexProperty).GetProperty("CT"));

            Assert.Equal(1, attributes.Count());
            Assert.Equal(typeof(AttributeProviderEntityWithComplexProperty), ((CustomValidationAttribute)attributes.First()).ValidatorType);
            Assert.Equal("ValidateProperty", ((CustomValidationAttribute)attributes.First()).Method);
        }
        public void GetAttributes_returns_correct_set_of_empty_type_attributes()
        {
            var attributes = new AttributeProvider().GetAttributes(typeof(AttributeProviderTestEmptyClass));

            Assert.Equal(0, attributes.Count());
        }
        public void GetAttributes_returns_empty_enumerable_when_no_property_descriptor()
        {
            var attributes = new AttributeProvider().GetAttributes(new MockPropertyInfo());

            Assert.Equal(0, attributes.Count());
        }
        public void GetAttributes_returns_correct_set_of_empty_type_attributes()
        {
            var attributes = new AttributeProvider().GetAttributes(typeof(AttributeProviderTestEmptyClass));

            Assert.Equal(0, attributes.Count());
        }
        public void GetAttributes_returns_empty_enumerable_when_no_property_descriptor()
        {
            var attributes = new AttributeProvider().GetAttributes(new MockPropertyInfo());

            Assert.Equal(0, attributes.Count());
        }