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