public void GetBreadcrumb_FormsBreadcrumbByIgnoringCase()
        {
            routeValues["controller"] = "profile";
            routeValues["action"]     = "edit";
            routeValues["area"]       = null;

            MvcSiteMapNode[] actual = provider.GetBreadcrumb(requestContext).ToArray();

            Assert.Equal(3, actual.Length);

            Assert.Equal("fa fa-home", actual[0].IconClass);
            Assert.Equal("Home", actual[0].Controller);
            Assert.Equal("Index", actual[0].Action);
            Assert.Null(actual[0].Area);

            Assert.Equal("fa fa-user", actual[1].IconClass);
            Assert.Equal("Profile", actual[1].Controller);
            Assert.Null(actual[1].Action);
            Assert.Null(actual[1].Area);

            Assert.Equal("fa fa-pencil", actual[2].IconClass);
            Assert.Equal("Profile", actual[2].Controller);
            Assert.Equal("Edit", actual[2].Action);
            Assert.Null(actual[2].Area);
        }
        public void GetBreadcrumb_IsCaseInsensitive()
        {
            route["controller"] = "profile";
            route["action"]     = "edit";
            route["area"]       = null;

            MvcSiteMapNode[] actual = siteMap.GetBreadcrumb(context).ToArray();

            Assert.Equal(3, actual.Length);

            Assert.Equal("fa fa-home", actual[0].IconClass);
            Assert.Equal("Home", actual[0].Controller);
            Assert.Equal("Index", actual[0].Action);
            Assert.Null(actual[0].Area);

            Assert.Equal("fa fa-user", actual[1].IconClass);
            Assert.Equal("Profile", actual[1].Controller);
            Assert.Null(actual[1].Action);
            Assert.Null(actual[1].Area);

            Assert.Equal("fa fa-pencil-alt", actual[2].IconClass);
            Assert.Equal("Profile", actual[2].Controller);
            Assert.Equal("Edit", actual[2].Action);
            Assert.Null(actual[2].Area);
        }
示例#3
0
        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);
        }