Exemplo n.º 1
0
 public override void SetUp()
 {
     base.SetUp();
     data = new XmlIncludeTypeData("string", "System.String, mscorlib");
     node = new XmlIncludeTypeNode(data);
     CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
 }
 public override void SetUp()
 {
     base.SetUp();
     data = new XmlIncludeTypeData("string", "System.String, mscorlib");
     node = new XmlIncludeTypeNode(data);
     CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
 }
Exemplo n.º 3
0
 public void CreateDefaultTest()
 {
     XmlIncludeTypeNode xmlIncludeTypeNode = new XmlIncludeTypeNode();
     CreateHierarchyAndAddToHierarchyService(xmlIncludeTypeNode, CreateDefaultConfiguration());
     Assert.AreEqual(SR.DefaultXmlIncludeTypeNodeName, xmlIncludeTypeNode.Name);
     Assert.AreEqual(SR.DefaultXmlIncludeTypeNodeName, xmlIncludeTypeNode.XmlIncludeTypeData.Name);
 }
        public void CreateDefaultTest()
        {
            XmlIncludeTypeNode xmlIncludeTypeNode = new XmlIncludeTypeNode();

            CreateHierarchyAndAddToHierarchyService(xmlIncludeTypeNode, CreateDefaultConfiguration());
            Assert.AreEqual(SR.DefaultXmlIncludeTypeNodeName, xmlIncludeTypeNode.Name);
            Assert.AreEqual(SR.DefaultXmlIncludeTypeNodeName, xmlIncludeTypeNode.XmlIncludeTypeData.Name);
        }
Exemplo n.º 5
0
 public void CreateNameTest()
 {
     string name = "MyName";
     XmlIncludeTypeNode xmlIncludeTypeNode = new XmlIncludeTypeNode(new XmlIncludeTypeData(name));
     CreateHierarchyAndAddToHierarchyService(xmlIncludeTypeNode, CreateDefaultConfiguration());
     Assert.AreEqual(name, xmlIncludeTypeNode.Name);
     Assert.AreEqual(name, xmlIncludeTypeNode.XmlIncludeTypeData.Name);
 }
        public void CreateNameTest()
        {
            string             name = "MyName";
            XmlIncludeTypeNode xmlIncludeTypeNode = new XmlIncludeTypeNode(new XmlIncludeTypeData(name));

            CreateHierarchyAndAddToHierarchyService(xmlIncludeTypeNode, CreateDefaultConfiguration());
            Assert.AreEqual(name, xmlIncludeTypeNode.Name);
            Assert.AreEqual(name, xmlIncludeTypeNode.XmlIncludeTypeData.Name);
        }
Exemplo n.º 7
0
 public void ChangeDisplayNameShouldChangeNameTest()
 {
     string name = "Name";
     XmlIncludeTypeNode xmlIncludeTypeNode = new XmlIncludeTypeNode(new XmlIncludeTypeData(name));
     CreateHierarchyAndAddToHierarchyService(xmlIncludeTypeNode, CreateDefaultConfiguration());
     Assert.AreEqual(xmlIncludeTypeNode.Name, xmlIncludeTypeNode.Name);
     xmlIncludeTypeNode.Name = "newName1";
     Assert.AreEqual(xmlIncludeTypeNode.Name, xmlIncludeTypeNode.Name);
     xmlIncludeTypeNode.Name = "newName2";
     Assert.AreEqual(xmlIncludeTypeNode.Name, xmlIncludeTypeNode.Name);
 }
        public void ChangeDisplayNameShouldChangeNameTest()
        {
            string             name = "Name";
            XmlIncludeTypeNode xmlIncludeTypeNode = new XmlIncludeTypeNode(new XmlIncludeTypeData(name));

            CreateHierarchyAndAddToHierarchyService(xmlIncludeTypeNode, CreateDefaultConfiguration());
            Assert.AreEqual(xmlIncludeTypeNode.Name, xmlIncludeTypeNode.Name);
            xmlIncludeTypeNode.Name = "newName1";
            Assert.AreEqual(xmlIncludeTypeNode.Name, xmlIncludeTypeNode.Name);
            xmlIncludeTypeNode.Name = "newName2";
            Assert.AreEqual(xmlIncludeTypeNode.Name, xmlIncludeTypeNode.Name);
        }
        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);
        }