コード例 #1
0
ファイル: SqlExpTest.cs プロジェクト: eksotama/Suilder
        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);
        }
コード例 #2
0
ファイル: SqlExpTest.cs プロジェクト: eksotama/Suilder
        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);
        }