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

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

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

            QueryResult result = engine.Compile(func);

            Assert.Equal("AVG(DISTINCT `person`.`Salary`)", result.Sql);
            Assert.Equal(new Dictionary <string, object>(), result.Parameters);
        }