MySql.Data.Entity.Tests.ProceduresAndFunctions.Update C# (CSharp) Method

Update() private method

private Update ( ) : void
return void
        public void Update()
        {
            MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM Authors", conn);
            DataTable dt = new DataTable();
            da.Fill(dt);
            int count = dt.Rows.Count;

            using (testEntities context = new testEntities())
            {
                var q = from a in context.Authors
                        where a.Name == "Don Box"
                        select a;
               foreach (Author a in q)
                   a.Name = "Dummy";
               context.SaveChanges();
            }

            da.SelectCommand.CommandText = "SELECT * FROM Authors WHERE name='Dummy'";
            dt.Clear();
            da.Fill(dt);
            Assert.AreEqual(1, dt.Rows.Count);
        }