Esempio n. 1
0
 public void AddNode()
 {
     TreeNodeFactory.Register(typeof(MyConfigurationNode), typeof(MyConfigurationTreeNode));
     MockConfigurationTreeNode treeNode = new MockConfigurationTreeNode("test");
     MyConfigurationNode childNode = new MyConfigurationNode("test");
     treeNode.ConfigurationNode.Nodes.Add(childNode);
     Assert.AreEqual(1, treeNode.Nodes.Count);
     ConfigurationTreeNode childTreeNode = treeNode.Nodes[0] as ConfigurationTreeNode;
     Assert.AreSame(childTreeNode.ConfigurationNode, childNode);
     Assert.AreEqual(typeof(MyConfigurationTreeNode), childTreeNode.GetType());
 }
Esempio n. 2
0
        public void AddNode()
        {
            TreeNodeFactory.Register(typeof(MyConfigurationNode), typeof(MyConfigurationTreeNode));
            MockConfigurationTreeNode treeNode  = new MockConfigurationTreeNode("test");
            MyConfigurationNode       childNode = new MyConfigurationNode("test");

            treeNode.ConfigurationNode.Nodes.Add(childNode);
            Assert.AreEqual(1, treeNode.Nodes.Count);
            ConfigurationTreeNode childTreeNode = treeNode.Nodes[0] as ConfigurationTreeNode;

            Assert.AreSame(childTreeNode.ConfigurationNode, childNode);
            Assert.AreEqual(typeof(MyConfigurationTreeNode), childTreeNode.GetType());
        }