public void DataControlFieldCollection_Insert() { DataControlFieldCollection collection = new DataControlFieldCollection(); BoundField field = new BoundField(); collection.Add(new BoundField()); collection.Add(new BoundField()); Assert.AreEqual(2, collection.Count, "CollectionCount"); collection.Insert(0, field); int result = collection.IndexOf(field); Assert.AreEqual(0, result, "Insert"); }
public void DataControlFieldCollection_FieldsChangedEvent() { DataControlFieldCollection collection = new DataControlFieldCollection(); collection.FieldsChanged += new EventHandler(collection_FieldsChanged); BoundField field = new BoundField(); collection.Add(field); Assert.AreEqual(true, EventDone, "FieldsChangedEvenAdd"); ResetEvent(); collection.Clear(); Assert.AreEqual(true, EventDone, "FieldsChangedEvenClear"); ResetEvent(); collection.Insert(0, field); Assert.AreEqual(true, EventDone, "FieldsChangedEvenInsert"); ResetEvent(); collection.Remove(field); Assert.AreEqual(true, EventDone, "FieldsChangedEvenRemove"); }