package object; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import net.locusworks.lsproject.object.Connection; public class ConnectionTest { private Connection testConnection; @Before public void setUpBeforeTest(){ testConnection = new Connection("1", "2", 4); } @Test public void testGetCost() { assertEquals(4, testConnection.getCost()); } @Test public void testSetCost() { testConnection.setCost(21); assertEquals(21, testConnection.getCost()); } @Test public void testGetFirstParticipantAddress() { assertEquals("1", testConnection.getFirstParticipantAddress()); } @Test public void testGetSecondParticipantAddress() { assertEquals("2", testConnection.getSecondParticipantAddress()); } @Test public void testSetParticipants() { testConnection.setParticipants("100", "200"); assertEquals("100", testConnection.getFirstParticipantAddress()); assertEquals("200", testConnection.getSecondParticipantAddress()); } }