Пример #1
0
        public void Remove()
        {
            var cut          = new SortedBindingList <Data>();
            var raisedEvents = new List <ListChangedEventArgs>();

            cut.ListChanged += (s, e) => raisedEvents.Add(e);

            var data = new Data();

            cut.Add(data);
            cut.Remove(data);

            var last = raisedEvents.Last();

            Assert.AreEqual(0, cut.Count);
            Assert.AreEqual(ListChangedType.ItemDeleted, last.ListChangedType);
            Assert.AreEqual(0, last.NewIndex);
        }