예제 #1
0
        public void Remove_ReturnsFalseForItemNotInList()
        {
            PageVirtualizingList<int> list = new PageVirtualizingList<int>();
            list.UpdateCount(20, 6);
            list[2] = 8;
            list[5] = 10;
            list[10] = 42;

            bool result = list.Remove(12);

            Assert.AreEqual(false, result);
        }
예제 #2
0
        public void Remove_RemovesItemFromList()
        {
            PageVirtualizingList<int> list = new PageVirtualizingList<int>();
            list.UpdateCount(20, 6);
            list[2] = 8;
            list[5] = 10;
            list[10] = 42;

            list.Remove(10);

            Assert.AreEqual(19, list.Count);
            Assert.AreEqual(8, list[2]);
            Assert.AreEqual(42, list[9]);
        }