size() публичный Метод

The total number of references in this table of contents.
public size ( ) : int
Результат int
 public void testAddResource1()
 {
     Resource resource = new Resource("foo");
     TableOfContents toc = new TableOfContents();
     TOCReference tocReference = toc.addSection(resource, "apple/pear", "/");
     Assert.IsNotNull(tocReference);
     Assert.IsNotNull(tocReference.getResource());
     Assert.AreEqual(2, toc.size());
     Assert.AreEqual("pear", tocReference.getTitle());
 }
        public void testAddResourceWithIndexes()
        {
            Resource resource = new Resource("foo");
            TableOfContents toc = new TableOfContents();
            TOCReference tocReference = toc.addSection(resource, new int[] { 0, 0 }, "Section ", ".");

            // check newly created TOCReference
            Assert.IsNotNull(tocReference);
            Assert.IsNotNull(tocReference.getResource());
            Assert.AreEqual("Section 1.1", tocReference.getTitle());

            // check table of contents
            Assert.AreEqual(1, toc.getTocReferences().Count);
            Assert.AreEqual(1, toc.getTocReferences()[0].getChildren().Count);
            Assert.AreEqual(2, toc.size());
            Assert.AreEqual("Section 1", toc.getTocReferences()[0].getTitle());
            Assert.AreEqual("Section 1.1", toc.getTocReferences()[0].getChildren()[0].getTitle());
            Assert.AreEqual(1, toc.getTocReferences()[0].getChildren().Count);
        }