public void LTrim_Character() { Person person = new Person(); Exception ex = Assert.Throws <InvalidOperationException>(() => SqlExp.LTrim(person.Name, ",")); Assert.Equal("Only for expressions.", ex.Message); }
public void LTrim() { Person person = null; IFunction func = (IFunction)sql.Val(() => SqlExp.LTrim(person.Name)); QueryResult result = engine.Compile(func); Assert.Equal("TRIM(LEADING FROM `person`.`Name`)", result.Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }
public void LTrim() { Person person = null; IFunction func = (IFunction)sql.Val(() => SqlExp.LTrim(person.Name)); QueryResult result = engine.Compile(func); Assert.Equal("LTRIM(\"PERSON\".\"NAME\")", result.Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }
public void LTrim_Trim_Leading() { engine.AddFunction(FunctionName.LTrim, FunctionHelper.TrimLeading); Person person = null; IFunction func = (IFunction)sql.Val(() => SqlExp.LTrim(person.Name)); QueryResult result = engine.Compile(func); Assert.Equal("TRIM(LEADING FROM \"person\".\"Name\")", result.Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }
public void LTrim_Character() { Person person = null; IFunction func = (IFunction)sql.Val(() => SqlExp.LTrim(person.Name, ",")); QueryResult result = engine.Compile(func); Assert.Equal("LTRIM(\"person\".\"Name\", @p0)", result.Sql); Assert.Equal(new Dictionary <string, object>() { ["@p0"] = "," }, result.Parameters); }