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