Files
lsproject/src/test/java/object/ConnectionTest.java
Isaac Parenteau 40e2af6a93
All checks were successful
Locusworks Team/lsproject/pipeline/head This commit looks good
Added old project initial commit
2021-10-18 19:26:42 -05:00

50 lines
1.0 KiB
Java

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());
}
}