Ejemplo n.º 1
0
        public void DerivedOnListChanged()
        {
            bool called = false;

            DerivedEditableList <int> list = new DerivedEditableList <int>();

            list.OnListChangedCalled += delegate
            {
                called = true;
            };

            list.Add(1);

            Assert.IsTrue(called);
            Assert.AreEqual(1, list.NewItems.Count);
            Assert.AreEqual(1, list.Count);
            Assert.AreEqual(0, list.DelItems.Count);

            called = false;
            list.RemoveAt(0);

            Assert.IsTrue(called);
            Assert.AreEqual(0, list.NewItems.Count);
            Assert.AreEqual(0, list.Count);
            Assert.AreEqual(0, list.DelItems.Count);
        }
Ejemplo n.º 2
0
        public void DerivedOnListChanged()
        {
            var called = false;
            var list   = new DerivedEditableList <int>();

            list.OnListChangedCalled += (sender, args) => called = true;

            list.Add(1);

            Assert.IsTrue(called);
            Assert.AreEqual(1, list.NewItems.Count);
            Assert.AreEqual(1, list.Count);
            Assert.AreEqual(0, list.DelItems.Count);

            called = false;
            list.RemoveAt(0);

            Assert.IsTrue(called);
            Assert.AreEqual(0, list.NewItems.Count);
            Assert.AreEqual(0, list.Count);
            Assert.AreEqual(0, list.DelItems.Count);
        }