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