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

MaxInSubQuery1() private method

private MaxInSubQuery1 ( ) : void
return void
        public void MaxInSubQuery1()
        {
            MySqlDataAdapter da= new MySqlDataAdapter(
                "SELECT s.* FROM Stores AS s WHERE s.id=(SELECT MAX(o.storeId) FROM Orders AS o)", conn);
            DataTable dt = new DataTable();
            da.Fill(dt);

            using (testEntities context = new testEntities())
            {
                string sql = @"SELECT VALUE s FROM Stores AS s WHERE s.Id = 
                                MAX(SELECT VALUE o.Store.Id FROM Orders As o)";
                ObjectQuery<Store> q = context.CreateQuery<Store>(sql);

                int i = 0;
                foreach (Store s in q)
                    Assert.AreEqual(dt.Rows[i++]["id"], s.Id);
            }
        }