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