public void Sum()
        {
            Person person = new Person();

            Exception ex = Assert.Throws <InvalidOperationException>(() => SqlExp.Sum(person.Salary));

            Assert.Equal("Only for expressions.", ex.Message);
        }
示例#2
0
        public void Sum()
        {
            Person    person = null;
            IFunction func   = (IFunction)sql.Val(() => SqlExp.Sum(person.Salary));

            QueryResult result = engine.Compile(func);

            Assert.Equal("SUM(`person`.`Salary`)", result.Sql);
            Assert.Equal(new Dictionary <string, object>(), result.Parameters);
        }
示例#3
0
        public object Method_Args()
        {
            Person person = null;

            return(sql.Val(() => SqlExp.Sum(person.Salary)));
        }