Node CreateFooterNode(float x, float y) { Node node = new FooterNode(); node.SetPosition(new Rect(x, y, 100, 100)); graphView.AddElement(node); return(node); }
public void StackNodeContainsAddedElements() { // Create a stack StackNode stack = CreateFilteredStackNode(k_DefaultX, k_DefaultY); Node footer; // Verify that nodes are properly added to the stack stack.AddElement(m_Node1); stack.AddElement(m_Node2); stack.InsertElement(0, m_Node3); stack.InsertElement(0, footer = new FooterNode()); Assert.AreEqual(4, stack.childCount); Assert.AreEqual(stack, m_Node1.parent); Assert.AreEqual(stack, m_Node2.parent); Assert.AreEqual(stack, m_Node3.parent); Assert.AreEqual(stack, footer.parent); Assert.AreEqual(0, stack.IndexOf(m_Node3)); // Verify that the footer is added at the end of the stack even though we tried to insert it at the begining Assert.AreEqual(stack.childCount - 1, stack.IndexOf(footer)); }