public void Trim_Character() { Person person = null; IFunction func = (IFunction)sql.Val(() => SqlExp.Trim(person.Name, ",")); QueryResult result = engine.Compile(func); Assert.Equal("TRIM(\"person\".\"Name\", @p0)", result.Sql); Assert.Equal(new Dictionary <string, object>() { ["@p0"] = "," }, result.Parameters); }
public void Trim_Character_Both() { engine.AddFunction(FunctionName.Trim, FunctionHelper.TrimBoth); Person person = null; IFunction func = (IFunction)sql.Val(() => SqlExp.Trim(person.Name, ",")); QueryResult result = engine.Compile(func); Assert.Equal("TRIM(@p0 FROM \"person\".\"Name\")", result.Sql); Assert.Equal(new Dictionary <string, object>() { ["@p0"] = "," }, result.Parameters); }