getEntryCount() public method

Total number of file entries stored in the index. This count includes unmerged stages for a file entry if the file is currently conflicted in a merge. This means the total number of entries in the index may be up to 3 times larger than the number of files in the working directory. Note that this value counts only files.
public getEntryCount ( ) : int
return int
        public void testReadIndex_LsFiles()
        {
            List<CGitIndexRecord> ls = ReadLsFiles();
            var dc = new DirCache(_index);
            Assert.AreEqual(0, dc.getEntryCount());
            dc.read();
            Assert.AreEqual(ls.Count, dc.getEntryCount());

            int i = 0;
            foreach (var val in ls)
            {
                AssertAreEqual(val, dc.getEntry(i));
                i++;
            }
        }
        public void testTreeWalk_LsFiles()
        {
            global::GitSharp.Core.Repository db = createBareRepository();
            List<CGitIndexRecord> ls = ReadLsFiles();
            var dc = new DirCache(_index);
            Assert.AreEqual(0, dc.getEntryCount());
            dc.read();
            Assert.AreEqual(ls.Count, dc.getEntryCount());

            var rItr = ls.GetEnumerator();
            var tw = new TreeWalk(db);
            tw.reset();
            tw.Recursive = true;
            tw.addTree(new DirCacheIterator(dc));
            while (rItr.MoveNext())
            {
                Assert.IsTrue(tw.next());
                var dcItr = tw.getTree<DirCacheIterator>(0, typeof(DirCacheIterator));
                Assert.IsNotNull(dcItr);
                AssertAreEqual(rItr.Current, dcItr.getDirCacheEntry());
            }
        }
        public void testReadIndex_DirCacheTree()
        {
            List<CGitIndexRecord> cList = ReadLsFiles();
            List<CGitLsTreeRecord> cTree = ReadLsTree();
            var dc = new DirCache(_index);
            Assert.AreEqual(0, dc.getEntryCount());
            dc.read();
            Assert.AreEqual(cList.Count, dc.getEntryCount());

            DirCacheTree jTree = dc.getCacheTree(false);
            Assert.IsNotNull(jTree);
            Assert.AreEqual(string.Empty, jTree.getNameString());
            Assert.AreEqual(string.Empty, jTree.getPathString());
            Assert.IsTrue(jTree.isValid());
            Assert.AreEqual(ObjectId
                    .FromString("698dd0b8d0c299f080559a1cffc7fe029479a408"), jTree
                    .getObjectId());
            Assert.AreEqual(cList.Count, jTree.getEntrySpan());

            var subtrees = new List<CGitLsTreeRecord>();
            foreach (CGitLsTreeRecord r in cTree)
            {
                if (FileMode.Tree.Equals(r.Mode))
                    subtrees.Add(r);
            }
            Assert.AreEqual(subtrees.Count, jTree.getChildCount());

            for (int i = 0; i < jTree.getChildCount(); i++)
            {
                DirCacheTree sj = jTree.getChild(i);
                CGitLsTreeRecord sc = subtrees[i];
                Assert.AreEqual(sc.Path, sj.getNameString());
                Assert.AreEqual(sc.Path + "/", sj.getPathString());
                Assert.IsTrue(sj.isValid());
                Assert.AreEqual(sc.Id, sj.getObjectId());
            }
        }
 public void testUnsupportedOptionalExtension()
 {
     var dc = new DirCache(pathOf("gitgit.index.ZZZZ"));
     dc.read();
     Assert.AreEqual(1, dc.getEntryCount());
     Assert.AreEqual("A", dc.getEntry(0).getPathString());
 }
        public void testReadIndex_LsFiles()
        {
            List<CGitIndexRecord> ls = ReadLsFiles();
            var dc = new DirCache(_index);
            Assert.AreEqual(0, dc.getEntryCount());
            dc.read();
            Assert.AreEqual(ls.Count, dc.getEntryCount());

            var cache = new List<DirCacheEntry>();

            for (int i = 0; i < dc.getEntryCount(); i++)
            {
                cache.Add(dc.getEntry(i));
            }

            ls.Sort((x, y) => x.Path.CompareTo(y.Path));
            cache.Sort((x, y) => x.getPathString().CompareTo(y.getPathString()));

            int j = 0;
            foreach (var val in ls)
            {
                AssertAreEqual(val, cache[j]);
                j++;
            }
        }