Skip to content

Instantly share code, notes, and snippets.

@CaglarGonul
Created March 15, 2013 21:13
Show Gist options
  • Save CaglarGonul/5173144 to your computer and use it in GitHub Desktop.
Save CaglarGonul/5173144 to your computer and use it in GitHub Desktop.
Simple BinaryTree tester
import com.cgon.BinaryTree;
import static org.junit.Assert.*;
import org.junit.Test;
public class JUnitTest {
BinaryTree node1 = new BinaryTree(2,null,null);
BinaryTree node2 = new BinaryTree(3,null,null);
BinaryTree node3 = new BinaryTree(4, node1, node2);
BinaryTree node4 = new BinaryTree(5, null, null);
BinaryTree root = new BinaryTree(6, node3, node4);
@Test
public void test_sum(){
assertEquals(20, root.sumAll());
System.out.println(root.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment