public void GetNodeByName_Should_Retrieve_Node_By_Name() { var tracker = new NodeTracker(); var node1 = new GraphNode("name1"); var node2 = new GraphNode("name2"); tracker.AddNode(node1); tracker.AddNode(node2); Assert.AreEqual(tracker.Nodes.Count(), 2); Assert.AreSame(tracker.GetNodeByName("name1"), node1); Assert.AreSame(tracker.GetNodeByName("name2"), node2); }
public void GetNodeByName_With_Invalid_Name_Should_Return_Null() { var tracker = new NodeTracker(); var node1 = new GraphNode("name1"); tracker.AddNode(node1); Assert.AreEqual(tracker.Nodes.Count(), 1); Assert.IsNull(tracker.GetNodeByName("name2")); }