public void QuerySameArgumentTwice() { Expression<Func<MyContext, int, string, MyValue>> lambda = (context, id, value) => context.Values.Where(v => v.Id < id).First(val => val.Id >= id); var provider = new CqlQueryProvider(); var plan = (QueryPlan<MyValue>)provider.CreateQueryPlan(lambda); Assert.AreEqual(2, plan.VariableMap.Count); Assert.AreEqual(plan.VariableMap[0], 0); Assert.AreEqual(plan.VariableMap[1], 0); Assert.AreEqual("SELECT \"id\",\"value\" FROM \"myvalue\" WHERE \"id\"<? AND \"id\">=? LIMIT 1;", plan.Cql); }
public static void CheckCql(Expression query, string expectedCql) { var provider = new CqlQueryProvider(); var plan = provider.CreateQueryPlan(query); Assert.AreEqual(expectedCql, plan.Cql); }