Example #1
0
        public void AddSuccessor_SuccessorAddedTwice_SecondSuccessorNotAddedToSuccessors()
        {
            // arrange
            ConcreteNode testNode = new ConcreteNode(0, 0, "testNode");
            StubNode successor = new StubNode();

            // act
            testNode.AddSuccessor(successor);
            testNode.AddSuccessor(successor);

            // assert
            Assert.AreEqual(1, testNode.Successors.Where(pred => pred.Equals(successor)).Count());
        }
Example #2
0
        public void AddSuccessor_AddedSuccessorNull_ThrowsArgumentNullException()
        {
            // arrange
            ConcreteNode testNode = new ConcreteNode(0, 0, "testNode");

            // act
            testNode.AddSuccessor(null);
        }
Example #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));
        }