public void AddPredecessor_PredecessorAddedFirstTime_PredecessorAddedToPredecessors() { // arrange ConcreteNode testNode = new ConcreteNode(0, 0, "testNode"); StubNode predecessor = new StubNode(); // act testNode.AddPredecessor(predecessor); // assert Assert.IsTrue(testNode.Predecessors.Contains(predecessor)); }
public void AddPredecessor_PredecessorAddedTwice_SecondPredecessorNotAddedToPredecessors() { // arrange ConcreteNode testNode = new ConcreteNode(0, 0, "testNode"); StubNode predecessor = new StubNode(); // act testNode.AddPredecessor(predecessor); testNode.AddPredecessor(predecessor); // assert Assert.AreEqual(1, testNode.Predecessors.Where(pred => pred.Equals(predecessor)).Count()); }
public void AddSuccessor_SuccessorAddedFirstTime_SuccessorAddedToSuccessors() { // arrange ConcreteNode testNode = new ConcreteNode(0, 0, "testNode"); StubNode successor = new StubNode(); // act testNode.AddSuccessor(successor); // assert Assert.IsTrue(testNode.Successors.Contains(successor)); }