コード例 #1
0
 public void Enqueue(Node newNode)
 {
     newNode.SetNextNode(tailNode);
     tailNode = newNode;
     if (tailNode.GetNextNode() == null)
     {
         headNode = tailNode;
     }
 }
コード例 #2
0
 public void ShouldBeAbleToGetAndSetNextNode()
 {
     Node nodeOne = new Node();
     Node target = new Node(nodeOne);
     Node expected = nodeOne;
     Node actual = target.GetNextNode();
     Assert.AreEqual(expected, actual);
     Node newNode = new Node("Emily");
     target.SetNextNode(newNode);
     expected = newNode;
     actual = target.GetNextNode();
     Assert.AreEqual(expected, actual);
 }