public KLabel CreateInitializedKLabel(IKNode parent)
 {
     KLabel label = new KLabel();
     KShapeLayout shapeLayout = new KShapeLayout();
     label.KShapeLayout = shapeLayout;
     label.Text = "";
     label.Parent = parent;
     return label;
 }
        public void UpdatingParentNodeOnLabelUpdatesLabelList()
        {
            KNode parentNode = new KNode();
            KLabel label = new KLabel();

            label.Parent = parentNode;

            Assert.AreEqual(label, parentNode.LabelList[0]);
        }
        public void SetKLabelParentToNull()
        {
            KNode parentNode = new KNode();
            KLabel label = new KLabel();

            label.Parent = parentNode;

            label.Parent = null;

            Assert.AreEqual(null, label.Parent);
            Assert.AreEqual(0, parentNode.LabelList.Count);
        }
        public void ChangeParentForAKLabelParentsAreUpdated()
        {
            KNode oldParent = new KNode();
            KNode newParent = new KNode();
            KLabel label = new KLabel();

            label.Parent = oldParent;
            label.Parent = newParent;

            Assert.AreEqual(0, oldParent.LabelList.Count);
            Assert.AreEqual(1, newParent.LabelList.Count);
            Assert.AreEqual(label, newParent.LabelList[0]);
        }