public void DetailsView_PrepareControlHierarchy () { PokerDetailsView dv = new PokerDetailsView (); //dv.Render (); //Assert.AreEqual (0, dv.Controls.Count, "ControlHierarchy1"); //Assert.AreEqual (true, dv.controlHierarchy, "ControlHierarchy2"); dv.controlHierarchy = false; dv.AllowPaging = true; dv.DataSource = myds; dv.DataBind (); dv.Page = new Page (); dv.Render (); Assert.AreEqual (1, dv.Controls.Count, "ControlHierarchy3"); Assert.AreEqual (true, dv.controlHierarchy, "ControlHierarchy4"); Button bt = new Button (); dv.Page.EnableEventValidation = false; dv.Controls.Add (bt); dv.controlHierarchy = false; dv.Render (); Assert.AreEqual (2, dv.Controls.Count, "ControlHierarchy3"); Assert.AreEqual (true, dv.controlHierarchy, "ControlHierarchy4"); }