Пример #1
0
        public virtual void GetNextPolyNodeNotEmptyTest()
        {
            PolyNode node = new PolyNode();

            node.AddChild(new PolyNode());
            node.AddChild(new PolyNode());
            NUnit.Framework.Assert.AreSame(node.Childs[0], node.GetNext());
        }
Пример #2
0
        public virtual void GetNextPolyNodeWithSiblingTest()
        {
            PolyNode node   = new PolyNode();
            PolyNode child1 = new PolyNode();
            PolyNode child2 = new PolyNode();

            node.AddChild(child1);
            node.AddChild(child2);
            NUnit.Framework.Assert.AreSame(child2, child1.GetNext());
        }
Пример #3
0
        public virtual void GetChildCountTest()
        {
            PolyNode node = new PolyNode();

            node.AddChild(new PolyNode());
            NUnit.Framework.Assert.AreEqual(1, node.ChildCount);
        }
Пример #4
0
        public virtual void IsNotHoleTest()
        {
            PolyNode parent = new PolyNode();
            PolyNode child  = new PolyNode();

            parent.AddChild(child);
            NUnit.Framework.Assert.IsFalse(child.IsHole);
        }
Пример #5
0
        public virtual void SetAndGetParentTest()
        {
            PolyNode parentNode = new PolyNode();
            PolyNode child      = new PolyNode();

            parentNode.AddChild(child);
            NUnit.Framework.Assert.AreSame(parentNode, child.Parent);
        }
Пример #6
0
        public virtual void AddAndGetChildTest()
        {
            PolyNode node  = new PolyNode();
            PolyNode child = new PolyNode();

            node.AddChild(child);
            NUnit.Framework.Assert.AreSame(child, node.Childs[0]);
            NUnit.Framework.Assert.AreEqual(1, node.Childs.Count);
        }