Beispiel #1
0
        public void deleteNodeTest_emptyTree_throwError()
        {
            //arrange
            var myBST = new binarySearchTree <int>();

            //act
            myBST.deleteNode(1);
            //assert
        }
Beispiel #2
0
        public void deleteNodeTest_NodeThatDoesNotExist_throwError()
        {
            //arrange
            var myBST = new binarySearchTree <int>();

            //act
            myBST.addNode(2);
            myBST.deleteNode(1);
            //assert
        }
Beispiel #3
0
        public void deleteNodeTest_SingleInt_Returnint()
        {
            //arrange
            var myBST = new binarySearchTree <int>();

            //act
            myBST.addNode(1);
            myBST.addNode(2);
            myBST.addNode(3);
            myBST.addNode(4);
            int testDeleteNoteVal = myBST.deleteNode(4);

            //assert
            Assert.AreEqual(4, testDeleteNoteVal);
        }