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

MaxWithGrouping() private method

private MaxWithGrouping ( ) : void
return void
        public void MaxWithGrouping()
        {
            MySqlDataAdapter da = new MySqlDataAdapter(
                "SELECT MAX(Freight) FROM Orders GROUP BY StoreId", conn);
            DataTable dt = new DataTable();
            da.Fill(dt);

            using (testEntities context = new testEntities())
            {
                string sql = "SELECT VALUE MAX(o.Freight) FROM Orders AS o GROUP BY o.Store.Id";
                ObjectQuery<Double> q = context.CreateQuery<Double>(sql);

                int i = 0;
                foreach (double freight in q)
                    Assert.AreEqual(Convert.ToInt32(dt.Rows[i++][0]), Convert.ToInt32(freight));
            }
        }