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

add() public method

Add an entry to the end of the list.
public add ( int n ) : void
n int The nbumber to add
return void
        public void add(int n)
        {
            if (count == entries.Length)
                grow();
            entries[count++] = n;
        }

Usage Example

Example #1
0
        public void testAdd_SmallGroup()
        {
            IntList i = new IntList();
            int n = 5;
            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::add