package com.fishercoder;

import com.fishercoder.common.classes.TreeNode;
import com.fishercoder.solutions._606;
import org.junit.BeforeClass;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Created by stevesun on 6/4/17.
 */
public class _606Test {
    private static _606 test;
    private static TreeNode t;

    @BeforeClass
    public static void setup(){
        test = new _606();
    }

    @Test
    public void test1() {
        t = new TreeNode(1);
        t.left = new TreeNode(2);
        t.right = new TreeNode(3);
        t.left.left = new TreeNode(4);
        System.out.println("Test1");
        assertEquals("1(2(4))(3)", test.tree2str(t));
    }

    @Test
    public void test2() {
        t = new TreeNode(1);
        t.left = new TreeNode(2);
        t.right = new TreeNode(3);
        t.left.right = new TreeNode(4);
        System.out.println("Test2");
        assertEquals("1(2()(4))(3)", test.tree2str(t));
    }

    @Test
    public void test3() {
        t= new TreeNode(1);
        t.right = new TreeNode(2);
        t.right.right = new TreeNode(3);
        System.out.println("Test3");
        assertEquals("1()(2()(3))", test.tree2str(t));
    }
}

@@ -331,16 +331,23 @@
 eeNode t
+reeNode
 ;%0A%0A    @
@@ -461,32 +461,39 @@
 t1() %7B%0A        t
+reeNode
  = new TreeNode(
@@ -497,32 +497,39 @@
 de(1);%0A        t
+reeNode
 .left = new Tree
@@ -538,32 +538,39 @@
 de(2);%0A        t
+reeNode
 .right = new Tre
@@ -584,24 +584,31 @@
 );%0A        t
+reeNode
 .left.left =
@@ -704,32 +704,39 @@
  test.tree2str(t
+reeNode
 ));%0A    %7D%0A%0A    @
@@ -775,16 +775,23 @@
        t
+reeNode
  = new T
@@ -807,24 +807,31 @@
 );%0A        t
+reeNode
 .left = new 
@@ -844,32 +844,39 @@
 de(2);%0A        t
+reeNode
 .right = new Tre
@@ -894,16 +894,23 @@
        t
+reeNode
 .left.ri
@@ -1013,32 +1013,39 @@
  test.tree2str(t
+reeNode
 ));%0A    %7D%0A%0A    @
@@ -1084,16 +1084,24 @@
        t
+reeNode 
 = new Tr
@@ -1116,24 +1116,31 @@
 );%0A        t
+reeNode
 .right = new
@@ -1162,16 +1162,23 @@
        t
+reeNode
 .right.r
@@ -1289,16 +1289,23 @@
 ee2str(t
+reeNode
 ));%0A    

edit 606 test