コード例 #1
0
        public void BreadcrumbModel_FromHomeToCurrentPage()
        {
            this.CreateTestPages();

            var model = new BreadcrumbModel();
            var viewModel = model.CreateViewModel(null);

            for (int i = 0; i < BreadcrumbWidgetTests.TestPagesCount; i++)
            {
                var expected = SitefinitySiteMap.GetCurrentProvider().FindSiteMapNodeFromKey(this.createdPageIDs[i].ToString());
                var actual = viewModel.SiteMapNodes[i];

                Assert.AreEqual(expected.Title, actual.Title);
            }
        }
コード例 #2
0
        public void BreadcrumbModel_BreadcrumbExtender_VirtualNodes()
        {
            this.CreateTestPages();

            var model = new BreadcrumbModel();
            model.AllowVirtualNodes = true;
            var extender = new DummyBreadcrumbExtender();
            var viewModel = model.CreateViewModel(extender);

            Assert.AreEqual(BreadcrumbWidgetTests.TestPagesCount + 1, viewModel.SiteMapNodes.Count);

            for (int i = 0; i < BreadcrumbWidgetTests.TestPagesCount; i++)
            {
                var expected = SitefinitySiteMap.GetCurrentProvider().FindSiteMapNodeFromKey(this.createdPageIDs[i].ToString());
                var actual = viewModel.SiteMapNodes[i];

                Assert.AreEqual(expected.Title, actual.Title);
            }

            Assert.AreEqual(DummyBreadcrumbExtender.DummySiteMapNodeTitle, viewModel.SiteMapNodes.Last().Title);
        }