package atmsdriver.model; import atmsdriver.model.Station.DIRECTION; import java.util.ArrayList; import java.util.Set; import junit.framework.TestCase; /** * * @author jdalbey */ public class HighwayTest extends TestCase { Station alpha; Station beta; public HighwayTest(String testName) { super(testName); } @Override protected void setUp() throws Exception { super.setUp(); alpha = new Station(1,2,3,"A",new ArrayList(), 4, Station.DIRECTION.NORTH, 1.0); beta = new Station(1,2,3,"B",new ArrayList(), 4, Station.DIRECTION.SOUTH, 1.0); } @Override protected void tearDown() throws Exception { super.tearDown(); } public void testToString() { System.out.println("toString"); Highway instance = new Highway(5,null); String expResult = "5"; String result = instance.toString(); assertEquals(expResult, result); } public void testDirections() { ArrayList stations = new ArrayList(); stations.add(alpha); stations.add(beta); Highway h1 = new Highway(5,stations); Set dirs = h1.availDirs; assertTrue(dirs.contains(DIRECTION.NORTH)); assertTrue(dirs.contains(DIRECTION.SOUTH)); } }