public void AssociateAuthorizationRuleWithNode()
        {
            SiteMapBuilderService service = new SiteMapBuilderService();
            SiteMapNodeInfo node = new SiteMapNodeInfo("node");

            service.AddNode(node, "rule");

            Assert.AreEqual("rule", service.GetAuthorizationRule(node.Key));
        }
        public void AdminModuleInitializerGetsRegisterOnSiteMapAdministerPermissionsAsChildNode()
        {
            TestableModule module = new TestableModule();
            SiteMapBuilderService service = new SiteMapBuilderService();

            module.TestRegisterSiteMapInformation(service);

            SiteMapNodeInfo node = service.GetChildren(service.RootNode.Key)[0];

            Assert.AreEqual(1, service.GetChildren(node.Key).Count);
            Assert.AreEqual("AllowAdministerPermissions", service.GetAuthorizationRule(service.GetChildren(node.Key)[0].Key));
        }
        public void NodeThatDoesNotRequireAuthorizationReturnsNullAuthorizationRule()
        {
            SiteMapBuilderService service = new SiteMapBuilderService();
            SiteMapNodeInfo node = new SiteMapNodeInfo("node");

            service.AddNode(node);

            Assert.IsNull(service.GetAuthorizationRule(node.Key));
        }
        public void CanSpecifyAuthorizationRuleWhenAddingChildNode()
        {
            SiteMapBuilderService service = new SiteMapBuilderService();
            SiteMapNodeInfo parent = new SiteMapNodeInfo("parent");
            SiteMapNodeInfo child = new SiteMapNodeInfo("child");

            service.AddNode(parent);
            service.AddNode(child, parent, "rule");

            Assert.IsNull(service.GetAuthorizationRule(parent.Key));
            Assert.AreEqual("rule", service.GetAuthorizationRule(child.Key));
        }