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

clear() public method

Empty this list
public clear ( ) : void
return void
        public void clear()
        {
            count = 0;
        }

Usage Example

Example #1
0
        public void testClear()
        {
            IntList i = new IntList();
            int n = 5;
            for (int v = 0; v < n; v++)
                i.add(10 + v);
            Assert.AreEqual(n, i.size());

            i.clear();
            Assert.AreEqual(0, i.size());

            try
            {
                i.get(0);
                Assert.Fail("Accepted 0 index on empty list");
            }
            catch (IndexOutOfRangeException)
            {
                Assert.IsTrue(true);
            }
        }