Example #1
0
        public void When_property_type_is_collection_Then_returns_TRUE()
        {
            // Arrange
            var property = new ClassWithPropertiesAndReferences()
                           .Property(o => o.CustomTypesCollection);

            // Act
            var actual = sut.IsCollection(property);

            // Assert
            actual.Should().BeTrue();
        }
Example #2
0
        /// <inheritdoc cref="IPropertyAccessorFactory.Create"/>
        public IPropertyAccessor Create(PropertyInfo property)
        {
            var propertyName = property.Name;

            var isReference = referenceChecker.IsReference(property);

            var isCollection = collectionChecker.IsCollection(property);

            var propertyAttributes = attributeProvider.GetAttributes(property);

            var getter = CreateGetAccessor(property);

            return(new DelegatePropertyAccessor(propertyName, isReference, isCollection, propertyAttributes, getter));
        }