package hw04;

import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

class TreeTest {
	Tree testTree;

	@BeforeEach
	void setUp() throws Exception {
		testTree = new Tree(14.5);
		testTree.insert(21.7);
		testTree.insert(33.333);
	}

	@Test
	void testTree() { 
		assertEquals("14.50000, 21.70000, 33.33300",testTree.toString(),"Testing Tree constructor");
	}

	@Test
	void testInsert() { 
		testTree.insert(23.45);
		assertEquals("14.50000, 21.70000, 23.45000, 33.33300",testTree.toString(),"Testing Tree insert");
	}

	@Test
	void testToString() { 
		assertEquals("14.50000, 21.70000, 33.33300",testTree.toString(),"Testing Tree constructor");
	}

}
