Ejemplo n.º 1
0
        public override void SetUp()
        {
            base.SetUp();

            Type nodeType           = typeof(CustomAuthenticationProviderNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(CustomAuthenticationProviderData), SR.CustomAuthenticationProviderCommandName);

            NodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomRolesProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(CustomRolesProviderData), SR.CustomRolesProviderCommandName);
            NodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomAuthorizationProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(CustomAuthorizationProviderData), SR.CustomAuthorizationProviderCommandName);
            NodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomProfileProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(CustomProfileProviderData), SR.CustomProfileProviderCommandName);
            NodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomSecurityCacheProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(CustomSecurityCacheProviderData), SR.CustomSecurityCacheNodeCommandName);
            NodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(AuthorizationRuleProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(AuthorizationRuleProviderData), SR.AuthorizationRuleProviderCommandName);
            NodeCreationService.AddNodeCreationEntry(entry);
        }
        public override void SetUp()
        {
            base.SetUp();
            XmlIncludeTypeService.AddXmlIncludeType(section, typeof(MyConfigurationData));

            Type nodeType           = typeof(MyConfigurationNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(MyConfigurationData), "My Configuraiton Node");

            NodeCreationService.AddNodeCreationEntry(entry);
        }
        public void CanGetANodeWithNotADirectInheritanceChain()
        {
            string name = "Foo";

            Type nodeType           = typeof(MyDerivedNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(MyDerivedData), name);

            NodeCreationService.AddNodeCreationEntry(entry);

            StringCollection names = NodeCreationService.GetDisplayNames(typeof(StorageProviderNode));

            Assert.IsTrue(names.Contains(name));
        }
        public void CreateNodeTest()
        {
            Type t = typeof(InstrumentationNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(
                new AddChildNodeCommand(ServiceProvider, t),
                t, typeof(InstrumentationConfigurationSection), "Instrumentation");

            NodeCreationService.AddNodeCreationEntry(entry);

            InstrumentationNode node = NodeCreationService.CreateNodeByDataType(
                typeof(InstrumentationConfigurationSection)) as InstrumentationNode;

            Assert.IsNotNull(node);
        }
        public void CreateNodeTest()
        {
            Type t = typeof(XmlFileStorageProviderNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, t), t, typeof(XmlFileStorageProviderData), SR.XmlFileStorageProviderNodeTypeNameDescription);

            NodeCreationService.AddNodeCreationEntry(entry);

            t     = typeof(XmlSerializerTransformerNode);
            entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, t), t, typeof(XmlSerializerTransformerData), SR.XmlSerializerTransformerNodeFriendlyName);
            NodeCreationService.AddNodeCreationEntry(entry);

            XmlFileStorageProviderNode node = NodeCreationService.CreateNode(typeof(XmlFileStorageProviderData)) as XmlFileStorageProviderNode;

            Assert.IsNotNull(node);
        }