public void Succeeds()
        {
            var search = new DecimalSearch(nameof(Item.Value));

            var result = search.ApplyToQuery(Items().AsQueryable()).ToArray();

            result.Length.Should().Be(3);
        }
        public void Child_Succeeds()
        {
            Expression <Func <Foo, object> > expression = foo => foo.Bar.Value;
            var property = expression.ToString();
            var search   = new DecimalSearch(property);

            var result = search.ApplyToQuery(Foos().AsQueryable()).ToArray();

            result.Length.Should().Be(2);
            result[0].Id.Should().Be(4);
            result[1].Id.Should().Be(5);
        }
        public void Less_Succeeds()
        {
            var search = new DecimalSearch(nameof(Item.Value))
            {
                Term1 = 2.1M,
                Is    = DecimalSearch.Comparer.Less
            };

            var result = search.ApplyToQuery(Items().AsQueryable()).ToArray();

            result.Length.Should().Be(1);
            result[0].Id.Should().Be(1);
        }
        public void Children_Equals_Succeeds()
        {
            var search = new DecimalSearch($"Bars.{nameof(Bar.Value)}")
            {
                Is    = DecimalSearch.Comparer.Equal,
                Term1 = 5.0M
            };

            var result = search.ApplyToQuery(Foos2().AsQueryable()).ToArray();

            result.Length.Should().Be(1);
            result[0].Id.Should().Be(6);
        }
        public void Child_Equals_Succeeds()
        {
            Expression <Func <Foo, object> > expression = foo => foo.Bar.Value;
            var propert  = expression.GetPropertyPath();
            var property = string.Join(".", PropertyPath <Foo> .Get(x => x.Bar.Value).Select(x => x.Name));

            var search = new DecimalSearch(property)
            {
                Is    = DecimalSearch.Comparer.Equal,
                Term1 = 2.1M
            };
            var result = search.ApplyToQuery(Foos().AsQueryable()).ToArray();

            result.Length.Should().Be(1);
            result[0].Id.Should().Be(5);
        }