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