Example #1
0
        public void BinarySearchTree_02_FindMin_01_OnEmptyTree()
        {
            // Arrange
            IBinarySearchTree <int> tree = DSBuilder.CreateBinarySearchTreeIntEmpty();

            // Act & Assert
            Assert.Throws(typeof(BinarySearchTreeEmptyException), () => tree.FindMin());
        }
Example #2
0
        public void BinarySearchTree_02_FindMin_04_OnModerateIntTree()
        {
            // Arrange
            IBinarySearchTree <int> tree = DSBuilder.CreateBinarySearchTreeIntModerate();
            int expected = 3;

            // Act
            int actual = tree.FindMin();

            // Act & Assert
            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void BinarySearchTree_02_FindMin_02_OnTree1Element()
        {
            // Arrange
            IBinarySearchTree <int> tree = DSBuilder.CreateBinarySearchTreeInt1Element();
            int expected = 4;

            // Act
            int actual = tree.FindMin();

            // Act & Assert
            Assert.AreEqual(expected, actual);
        }