public void ReadTableOfContents_Visible()
        {
            // Arrange
            var root = Models.CreateDocumentationPage(order: 1, isHidden: false);

            DocumentationPageRepository.Create(root);
            var child = Models.CreateDocumentationPage(order: 1, parentPageId: root.Id, isHidden: true);

            DocumentationPageRepository.Create(child);
            var grandchild = Models.CreateDocumentationPage(order: 1, parentPageId: child.Id, isHidden: false);

            DocumentationPageRepository.Create(grandchild);

            // Act
            var toc = DocumentationPageRepository.ReadTableOfContents(false);

            // Assert
            Assert.AreEqual(1, toc.Count(), "Only one page should be returned because all other pages are hidden or beneath hidden pages.");
            Assert.AreEqual(root.Id, toc[0].Id, "The root page should be the only page included in the table of contents.");
        }
        public void ReadTableOfContents_All()
        {
            // Arrange
            var root_1 = Models.CreateDocumentationPage(order: 1);

            DocumentationPageRepository.Create(root_1);
            var child_1_1 = Models.CreateDocumentationPage(parentPageId: root_1.Id, order: 1);

            DocumentationPageRepository.Create(child_1_1);
            var child_1_1_1 = Models.CreateDocumentationPage(parentPageId: child_1_1.Id, order: 1);

            DocumentationPageRepository.Create(child_1_1_1);
            var child_1_2 = Models.CreateDocumentationPage(parentPageId: root_1.Id, order: 2);

            DocumentationPageRepository.Create(child_1_2);
            var root_2 = Models.CreateDocumentationPage(order: 2);

            DocumentationPageRepository.Create(root_2);
            var child_2_1 = Models.CreateDocumentationPage(parentPageId: root_2.Id, order: 1);

            DocumentationPageRepository.Create(child_2_1);

            // Act
            var toc = DocumentationPageRepository.ReadTableOfContents(true);

            // Assert
            Assert.AreEqual(6, toc.Count(), "Six pages should be returned in the table of contents.");
            Assert.IsNull(toc[0].Content, "Content should not be returned in the table of contents.");

            // Nodes are returned first by their depth starting with root nodes, then by their order, then by name.
            Assert.AreEqual(root_1.Id, toc[0].Id, "The first root node should be first in the table of contents.");
            Assert.AreEqual(root_2.Id, toc[1].Id, "The second root node should be returned second in the table of contents.");
            Assert.AreEqual(child_1_1.Id, toc[2].Id, "The first child node of the first root node should be returned third in the table of contents.");
            Assert.AreEqual(child_2_1.Id, toc[3].Id, "The child node of the second root node should be returned fourth in the table of contents.");
            Assert.AreEqual(child_1_2.Id, toc[4].Id, "The second child node of the first root node should be returned fifth in the table of contents.");
            Assert.AreEqual(child_1_1_1.Id, toc[5].Id, "The grandchild node should be returned sixth in the table of contents.");
        }