MySql.Data.Entity.Tests.AggregateOperators.MaxSimple C# (CSharp) Method

MaxSimple() private method

private MaxSimple ( ) : void
return void
        public void MaxSimple()
        {
            MySqlCommand trueCmd = new MySqlCommand("SELECT MAX(minage) FROM Toys", conn);
            int trueMax = (int)trueCmd.ExecuteScalar();

            using (testEntities context = new testEntities())
            {
                string sql = "SELECT VALUE MAX(t.MinAge) FROM Toys AS t";
                ObjectQuery<Int32> q = context.CreateQuery<Int32>(sql);

                foreach (int max in q)
                    Assert.AreEqual(trueMax, max);
            }
        }