Exemplo n.º 1
0
        //test mthod add(int,int)
        public virtual void TestAddAtIndex()
        {
            IntArrayList list = new IntArrayList();

            for (int i = 0; i < 10; i++)
            {
                list.Add(i);
            }
            list.Add(3, 100);
            Assert.AreEqual(100, list.Get(3));
            for (int i = 4; i < 11; i++)
            {
                Assert.AreEqual(i - 1, list.Get(i));
            }
        }
 public override int GetId(int index)
 {
     if (index < 0 || index >= Size())
     {
         throw new Db4oRecoverableException(new IndexOutOfRangeException());
     }
     return(_ids.Get(index));
 }