Ejemplo n.º 1
0
        public void CopyTo_CopiesToDestinationArray()
        {
            VirtualizingList<int> list = new VirtualizingList<int>();
            list.UpdateCount(20);
            list[2] = 8;
            list[10] = 42;

            int[] destination = new int[25];
            destination[1] = 1;
            destination[5] = 2;
            destination[22] = 3;

            list.CopyTo(destination, 2);

            CollectionAssert.AreEqual(new int[] { 0, 1, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0 }, destination);
        }