Esempio n. 1
0
        public void Insert_Exception_IndexIsGreaterThanCount()
        {
            PageVirtualizingList<int> list = new PageVirtualizingList<int>();
            list.UpdateCount(20, 6);

            Assert.ThrowsException<ArgumentOutOfRangeException>(() => list.Insert(21, 123));
        }
Esempio n. 2
0
        public void Insert_InsertsItemIntoList()
        {
            PageVirtualizingList<int> list = new PageVirtualizingList<int>();
            list.UpdateCount(20, 6);
            list[2] = 8;
            list[10] = 42;

            list.Insert(5, 123);

            Assert.AreEqual(21, list.Count);
            Assert.AreEqual(8, list[2]);
            Assert.AreEqual(123, list[5]);
            Assert.AreEqual(42, list[11]);
        }