public void ShouldBeEqualOperatorForString() { ODataUriParser parser = GetParser("/Enterprises?$filter=CorporateName%20eq%20%27Diego%27"); IQueryResolver resolver = new BinaryOperatorResolver(parser.ParseFilter().Expression as BinaryOperatorNode); resolver.Resolve().Should().Be("WHERE CorporateName LIKE 'Diego'"); }
public void ShouldBeLessThanOperatorForInt() { ODataUriParser parser = GetParser("/Enterprises?$filter=MonitoredPrinters%20lt%20135"); IQueryResolver resolver = new BinaryOperatorResolver(parser.ParseFilter().Expression as BinaryOperatorNode); resolver.Resolve().Should().Be("WHERE MonitoredPrinters < 135"); }
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 ShouldBeEqualOperatorEmpty() { IQueryResolver resolver = new BinaryOperatorResolver(null); resolver.Resolve().Should().BeEmpty(); }