public void GetNameShouldReturnAName() { Node target = new Node("Jacob"); string actual = target.GetName(); string expected = "Jacob"; Assert.AreEqual(expected, actual); }
public void SetNamesShouldChangeTheName() { Node target = new Node("Jacob"); target.SetName("George"); string actual = target.GetName(); string expected = "George"; Assert.AreEqual(expected, actual); }
private Node FindNodeByData(Node currentlySearchingNode, string data) { if (currentlySearchingNode.GetName() == data) { return currentlySearchingNode; } else if (currentlySearchingNode.GetNextNode() != null) { return FindNodeByData(currentlySearchingNode.GetNextNode(), data); } return null; // Recusion here is not ideal, due to the fact that, for a sufficiently large queue, this recursive loop will blow the stack }