import junit.framework.TestCase;

/*
 * Created on Feb 24, 2004
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */

/**
 * @author Administrator
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class BrowserHistoryTest extends TestCase {

	private BrowserHistory myHistory;
	/**
	 * Constructor for BrowserHistoryTest.
	 * @param arg0
	 */
	public BrowserHistoryTest(String arg0) {
		super(arg0);
	}

	public static void main(String[] args) {
		junit.swingui.TestRunner.run(BrowserHistoryTest.class);
	}
	
	public void setUp()
	{
		myHistory = new BrowserHistory();
	}

	public void testAdd() {
		myHistory.add("foo");
		assertEquals("foo", myHistory.getCurrent());
		myHistory.add("bar");
		assertEquals("bar", myHistory.getCurrent());
		assertEquals(true,myHistory.hasBack());	
	}
	public void testBack() {
		myHistory.add("foo");
		myHistory.add("bar");
		assertEquals("foo", myHistory.back());
		assertEquals(false,myHistory.hasBack());
		assertEquals(true,myHistory.hasNext());
	}

}
