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

MinWithGrouping() private method

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

            using (testEntities context = new testEntities())
            {
                string sql = "SELECT VALUE Min(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));
            }
        }