public void GetNodesForRoles_ReturnsAllRolesIfAllOfThemAreRootNodes()
        {
            var mockReader = GetMockReader();
            ISiteMapService service = new SiteMapService(mockReader.Object);

            var nodes = service.GetNodesForRole("Admin");

            Assert.IsNotNull(nodes);
            Assert.AreEqual(2, nodes.Count());
        }
        public void GetNodesForRoles_GroupsTheNodesProperly()
        {
            Mock<ISiteMapReader> mockReader = GetMockReader();
            ISiteMapService service = new SiteMapService(mockReader.Object);

            var nodes = service.GetNodesForRole("Admin");

            Assert.IsNotNull(nodes);

            SiteMapNode firstNode = nodes.SingleOrDefault(x => x.Id == 1);
            SiteMapNode secondNode = nodes.SingleOrDefault(x => x.Id == 4);

            Assert.AreEqual(2, firstNode.Children.Count());
            Assert.AreEqual(3, secondNode.Children.Count());
        }