Beispiel #1
0
        public void DataControlFieldCollection_Remove()
        {
            DataControlFieldCollection collection = new DataControlFieldCollection();
            BoundField field = new BoundField();

            collection.Add(field);
            Assert.AreEqual(1, collection.Count, "CollectionCount");
            collection.Remove(null);
            Assert.AreEqual(1, collection.Count, "RemoveNotExistField");
            collection.Remove(field);
            Assert.AreEqual(0, collection.Count, "RemoveExistField");
        }
Beispiel #2
0
        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");
        }