Exemplo n.º 1
0
        public void Property_IsNotFilterable_SetNotFilterableAndNonFilterable()
        {
            // Arrange
            StructuralTypeConfiguration structuralType = Mock.Of <StructuralTypeConfiguration>();
            Mock <PropertyInfo>         propertyInfo   = new Mock <PropertyInfo>();

            propertyInfo.SetupGet(p => p.PropertyType).Returns(typeof(int));
            PropertyConfiguration property = new PrimitivePropertyConfiguration(propertyInfo.Object, structuralType);

            // Act
            property.IsNotFilterable();

            // Assert
            Assert.True(property.NotFilterable);
            Assert.True(property.NonFilterable);
        }
        public void Property_IsNavigable_DoesntSetSortableAndFilterable()
        {
            // Arrange
            StructuralTypeConfiguration structuralType = Mock.Of<StructuralTypeConfiguration>();
            Mock<PropertyInfo> propertyInfo = new Mock<PropertyInfo>();
            propertyInfo.SetupGet(p => p.PropertyType).Returns(typeof(int));
            PropertyConfiguration property = new PrimitivePropertyConfiguration(propertyInfo.Object, structuralType);
            property.IsNotFilterable();
            property.IsNotSortable();

            // Act
            property.IsNavigable();

            // Assert
            Assert.True(property.NotFilterable);
            Assert.True(property.NotSortable);
        }