示例#1
0
        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));
        }
示例#2
0
        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());
        }
示例#3
0
        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));
        }