public void MakeSureThatIncludeTypesAreAddedForTheSection()
        {
            AddConfigurationSectionCommand cmd = new AddConfigurationSectionCommand(Host, typeof(MyConfigurationNode), section);

            cmd.Execute(GeneratedApplicationNode);

            ConfigurationSectionCollectionNode node = (ConfigurationSectionCollectionNode)GeneratedHierarchy.FindNodeByType(typeof(ConfigurationSectionCollectionNode));

            Assert.IsNotNull(node);
            ConfigurationSectionNode sectionNode = (ConfigurationSectionNode)GeneratedHierarchy.FindNodeByName(node, section);

            ConfigurationNode[] types = GeneratedHierarchy.FindNodesByType(sectionNode, typeof(XmlIncludeTypeNode));
            Assert.AreEqual(1, types.Length);
            XmlIncludeTypeNode xmlIncludeTypeNode = types[0] as XmlIncludeTypeNode;

            Assert.IsNotNull(xmlIncludeTypeNode);
            Assert.AreEqual(xmlIncludeTypeNode.Name, typeof(MyConfigurationData).Name);
        }
        public void TwoNodesShareTheSameConfigurationAndIncludeTypeRemoveOneIncludeTypeRemains()
        {
            AddConfigurationSectionCommand cmd = new AddConfigurationSectionCommand(Host, typeof(MyConfigurationNode), section);

            cmd.Execute(GeneratedApplicationNode);
            cmd.Execute(GeneratedApplicationNode);
            ConfigurationNode secondAddedNode = cmd.ChildNode;

            RemoveNodeCommand removeNodeCommand = new RemoveNodeCommand(Host);

            removeNodeCommand.Execute(secondAddedNode);

            ConfigurationSectionCollectionNode node = (ConfigurationSectionCollectionNode)GeneratedHierarchy.FindNodeByType(typeof(ConfigurationSectionCollectionNode));

            Assert.IsNotNull(node);
            ConfigurationSectionNode sectionNode = (ConfigurationSectionNode)GeneratedHierarchy.FindNodeByName(node, section);

            ConfigurationNode[] types = GeneratedHierarchy.FindNodesByType(sectionNode, typeof(XmlIncludeTypeNode));
            Assert.AreEqual(1, types.Length);
            XmlIncludeTypeNode xmlIncludeTypeNode = types[0] as XmlIncludeTypeNode;

            Assert.IsNotNull(xmlIncludeTypeNode);
            Assert.AreEqual(xmlIncludeTypeNode.Name, typeof(MyConfigurationData).Name);
        }