Exemplo n.º 1
0
        public void FindsSubtree()
        {
            var inputOne = TreeNode.BuildTreeThree();
            var inputTwo = TreeNode.BuildTreeThreeSubtree();

            var isSubtree = SubtreeOfAnotherTree.IsSubtree(inputOne, inputTwo);

            Assert.True(isSubtree);
        }
Exemplo n.º 2
0
        public void DoersNotFindSubtrees()
        {
            var inputOne = TreeNode.BuildTreeThree();
            var inputTwo = TreeNode.BuildTreeThreeFakeSubtree();

            var isSubtree = SubtreeOfAnotherTree.IsSubtree(inputOne, inputTwo);

            Assert.False(isSubtree);
        }