public void DetailsView_CreateAutoGeneratedRows_Ex2 () { PokerDetailsView dv = new PokerDetailsView (); ICollection col = dv.DoCreateAutoGeneratedRows (new Object ()); }
public void DetailsView_CreateAutoGeneratedRows () { PokerDetailsView dv = new PokerDetailsView (); DataTable ds = TableObject.CreateDataTable (); dv.DataSource = ds; dv.DataBind (); ICollection col = dv.DoCreateAutoGeneratedRows (dv.DataItem); Assert.AreEqual (typeof(ArrayList),col.GetType (),"CreateAutoGeneratedRowsType"); Assert.AreEqual (3, col.Count , "CreateAutoGeneratedRowsCount"); Assert.AreEqual (typeof (AutoGeneratedField), ((ArrayList) col)[0].GetType (), "AutoGeneratedRowType"); Assert.AreEqual ("ID", ((ArrayList) col)[0].ToString (), "AutoGeneratedRowName1"); Assert.AreEqual ("FName", ((AutoGeneratedField)((ArrayList) col)[1]).HeaderText, "AutoGeneratedRowName2"); Assert.AreEqual ("LName", ((AutoGeneratedField) ((ArrayList) col)[2]).SortExpression , "AutoGeneratedRowName3"); }
public void DetailsView_CreateAutoGeneratedRows2 () { PokerDetailsView dv = new PokerDetailsView (); ICollection col = dv.DoCreateAutoGeneratedRows (new TestObject ()); Assert.AreEqual (typeof (ArrayList), col.GetType (), "CreateAutoGeneratedRowsType"); Assert.AreEqual (4, col.Count, "CreateAutoGeneratedRowsCount"); Assert.AreEqual (typeof (AutoGeneratedField), ((ArrayList) col) [0].GetType (), "AutoGeneratedRowType"); Assert.IsFalse (((AutoGeneratedField) ((ArrayList) col) [0]).ReadOnly, "AutoGeneratedRowReadOnly1"); Assert.IsFalse (((AutoGeneratedField) ((ArrayList) col) [1]).ReadOnly, "AutoGeneratedRowReadOnly2"); Assert.IsFalse (((AutoGeneratedField) ((ArrayList) col) [2]).ReadOnly, "AutoGeneratedRowReadOnly2"); Assert.IsFalse (((AutoGeneratedField) ((ArrayList) col) [3]).ReadOnly, "AutoGeneratedRowReadOnly3"); col = dv.DoCreateAutoGeneratedRows ("aaa"); Assert.AreEqual (1, col.Count, "CreateAutoGeneratedRowsCount - IsBindableType"); col = dv.DoCreateAutoGeneratedRows (null); Assert.AreEqual (null, col, "null"); }