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

            // Act & Assert
            Assert.Throws(typeof(BinarySearchTreeEmptyException), () => tree.FindMin());
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }