public void GetNodes_ReturnsAllSiteMapNodes() { IEnumerable <MvcSiteMapNode> actual = TreeToEnumerable(parser.GetAllNodes(siteMap)); IEnumerable <MvcSiteMapNode> expected = TreeToEnumerable(GetSiteMap()); IEnumerable <MvcSiteMapNode> expectedParents = expected.Select(node => node.Parent); IEnumerable <MvcSiteMapNode> actualParents = actual.Select(node => node.Parent); TestHelper.EnumPropertyWiseEqual(expectedParents, actualParents); TestHelper.EnumPropertyWiseEqual(expected, actual); }
public void GetBreadcrumb_FormsBreadcrumbForCurrentAction() { routeValues["area"] = "administration"; routeValues["controller"] = "roles"; routeValues["action"] = "index"; List <MvcSiteMapNode> nodes = parser.GetAllNodes(siteMap).ToList(); MvcSiteMapBreadcrumb expected = CreateBreadcrumb(nodes[1], nodes[1].Children.First()); MvcSiteMapBreadcrumb actual = provider.GetBreadcrumb(); TestHelper.EnumPropertyWiseEqual(expected, actual); }