コード例 #1
0
        public void AdminModuleInitializerGetsRegisteredOnSiteMap()
        {
            TestableModule module = new TestableModule();
            SiteMapBuilderService service = new SiteMapBuilderService();

            module.TestRegisterSiteMapInformation(service);

            SiteMapNodeInfo node = service.GetChildren(service.RootNode.Key)[0];
            Assert.AreEqual("Admin", node.Key);
        }
コード例 #2
0
        public void AdminModuleInitializerRegistersTheAllowViewRolePermissionActionSet()
        {
            TestableModule         module  = new TestableModule();
            MockPermissionsCatalog catalog = new MockPermissionsCatalog();

            module.TestRegisterRequiredPermissions(catalog);

            Assert.IsNotNull(catalog.RegisteredPermissions["Admin"]);
            Assert.AreEqual(Permissions.AllowAdministerPermissions, catalog.RegisteredPermissions["Admin"].Actions[0].RuleName);
        }
コード例 #3
0
        public void AdminModuleInitializerGetsRegisteredOnSiteMap()
        {
            TestableModule        module  = new TestableModule();
            SiteMapBuilderService service = new SiteMapBuilderService();

            module.TestRegisterSiteMapInformation(service);

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

            Assert.AreEqual("Admin", node.Key);
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        public void AdminModuleInitializerRegistersTheAllowViewRolePermissionActionSet()
        {
            TestableModule module = new TestableModule();
            MockPermissionsCatalog catalog = new MockPermissionsCatalog();
            module.TestRegisterRequiredPermissions(catalog);

            Assert.IsNotNull(catalog.RegisteredPermissions["Admin"]);
            Assert.AreEqual(Permissions.AllowAdministerPermissions, catalog.RegisteredPermissions["Admin"].Actions[0].RuleName);
        }