GitSharp.Core.Util.IntList.get C# (CSharp) Method

get() public method

public get ( int i ) : int
i int index to Read, must be in the range [0, ).
return int
        public int get(int i)
        {
            if (count <= i)
                throw new IndexOutOfRangeException();
            return entries[i];
        }

Usage Example

Example #1
0
        public void testAdd_LargeGroup()
        {
            IntList i = new IntList();
            int n = 500;
            for (int v = 0; v < n; v++)
                i.add(10 + v);

            Assert.AreEqual(n, i.size());

            for (int v = 0; v < n; v++)
                Assert.AreEqual(10 + v, i.get(v));

            try
            {
                i.get(n);
                Assert.Fail("Accepted out of bound index on list");
            }
            catch (IndexOutOfRangeException)
            {
                Assert.IsTrue(true);
            }
        }
All Usage Examples Of GitSharp.Core.Util.IntList::get