public void Sum() { Person person = new Person(); Exception ex = Assert.Throws <InvalidOperationException>(() => SqlExp.Sum(person.Salary)); Assert.Equal("Only for expressions.", ex.Message); }
public void Sum() { Person person = null; IFunction func = (IFunction)sql.Val(() => SqlExp.Sum(person.Salary)); QueryResult result = engine.Compile(func); Assert.Equal("SUM(`person`.`Salary`)", result.Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }
public object Method_Args() { Person person = null; return(sql.Val(() => SqlExp.Sum(person.Salary))); }