public void AssertNonHandleable(string propertyName)
        {
            var handler  = new SimpleEnumerablePropertyTypePredicateHandler <FilterWithNonSimpleEnumerableProps, Entity>();
            var property = typeof(FilterWithNonSimpleEnumerableProps).GetProperty(propertyName);
            var result   = handler.CanHandle(property);

            Assert.False(result);
        }
        public void HandleShouldReturnNullForEmptyProperties(string propertyName)
        {
            var handler  = new SimpleEnumerablePropertyTypePredicateHandler <FilterWithSimpleEnumerableProps, Entity>();
            var property = typeof(FilterWithSimpleEnumerableProps).GetProperty(propertyName);
            var filter   = new FilterWithSimpleEnumerableProps();
            var result   = handler.Handle(filter, property);

            Assert.Null(result);
        }
        public void HandleShouldReturnExpectedResult(string propertyName)
        {
            var handler        = new SimpleEnumerablePropertyTypePredicateHandler <FilterWithSimpleEnumerableProps, Entity>();
            var property       = typeof(FilterWithSimpleEnumerableProps).GetProperty(propertyName);
            var filter         = new FilterWithSimpleEnumerableProps();
            var underlyingType = property.PropertyType.GetEnumerableUnderlyingType();
            var array          = Array.CreateInstance(underlyingType, 1);

            array.Initialize();
            property.SetValue(filter, array);
            var result = handler.Handle(filter, property);

            Assert.Matches($@"x => value\(.*\[\]\).Contains\(x\.{property.Name}\)", result.ToString());
        }