• Post Reply Bookmark Topic Watch Topic
  • New Topic

JUnit testing Binary Search Trees  RSS feed

 
Kevin Farmer
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create JUnit tests for a BST assignment, but I never created test cases for binary search trees.
How would I go about creating a test case for the insert method?

I appreciate the help!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37469
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kevin,
Start small. First write a test for an empty tree. Then one element. Then two. This lets you test the positions are correct as you go.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!