public void ShouldBeLikeOperatorForStartsWithString()
        {
            ODataUriParser parser = GetParser("/Enterprises?$filter=startswith(EnterpriseName,%27NP%27)");

            IQueryResolver resolver = new SingleValueFunctionResolver(parser.ParseFilter().Expression as SingleValueFunctionCallNode);

            resolver.Resolve().Should().Be("WHERE EnterpriseName LIKE 'NP%'");
        }
        public void ShouldBeLikeOperatorForContainsString()
        {
            ODataUriParser parser = GetParser("/Enterprises?$filter=contains(EnterpriseName,%27520%27)");

            IQueryResolver resolver = new SingleValueFunctionResolver(parser.ParseFilter().Expression as SingleValueFunctionCallNode);

            resolver.Resolve().Should().Be("WHERE EnterpriseName LIKE '%520%'");
        }
        public SqlFilterBinder(FilterClause filterClause)
        {
            if (filterClause != null)
            {
                //TODO: Resolver posteriormente de maneira mais elegante
                if (filterClause.Expression is BinaryOperatorNode)
                    Query = new BinaryOperatorResolver(filterClause.Expression as BinaryOperatorNode);

                else if (filterClause.Expression is SingleValueFunctionCallNode)
                    Query = new SingleValueFunctionResolver(filterClause.Expression as SingleValueFunctionCallNode);
            }
        }
        public void ShouldBeLikeOperatorEmpty()
        {
            IQueryResolver resolver = new SingleValueFunctionResolver(null);

            resolver.Resolve().Should().BeEmpty();
        }