Esempio n. 1
0
 public void TestListIterator1IndexOutOfBoundsException()
 {
     try
     {
         CopyOnWriteArrayList <Object> c = new CopyOnWriteArrayList <Object>();
         c.ListIterator(-1);
         ShouldThrow();
     }
     catch (IndexOutOfRangeException)
     {}
 }
Esempio n. 2
0
        public void TestListIterator2()
        {
            CopyOnWriteArrayList <Object> full = PopulatedArray(3);
            ListIterator <Object>         i    = full.ListIterator(1);
            int j;

            for (j = 0; i.HasNext; j++)
            {
                Assert.AreEqual(j + 1, i.Next());
            }
            Assert.AreEqual(2, j);
        }