public void AddToAuthors(Author author)
{
base.AddObject("Authors", author);
}
public void Insert() { 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()) { Author a = new Author(); a.Id = 23; a.Name = "Test name"; a.Age = 44; context.AddToAuthors(a); context.SaveChanges(); } dt.Clear(); da.Fill(dt); Assert.AreEqual(count + 1, dt.Rows.Count); Assert.AreEqual(23, dt.Rows[count]["id"]); }