Advertisement
IvetValcheva

test 1

Nov 21st, 2022
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import implementations.TreeFactory;
  2. import implementations.Tree;
  3.  
  4. import org.junit.Test;
  5.  
  6. import java.util.Collections;
  7. import java.util.List;
  8.  
  9. import static org.junit.Assert.*;
  10.  
  11. public class TreeCreationTest1 {
  12. @Test
  13. public void testTreeCreation1() {
  14. String[] input = {
  15. "0 1",
  16. "0 2",
  17. "1 3"
  18. };
  19.  
  20. TreeFactory treeFactory = new TreeFactory();
  21. Tree<Integer> tree = treeFactory.createTreeFromStrings(input);
  22. List<Tree<Integer>> trees = tree.subTreesWithGivenSum(6);
  23. assertEquals(1, trees.size());
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement