Added old project initial commit
All checks were successful
Locusworks Team/lsproject/pipeline/head This commit looks good
All checks were successful
Locusworks Team/lsproject/pipeline/head This commit looks good
This commit is contained in:
49
src/test/java/object/ConnectionTest.java
Normal file
49
src/test/java/object/ConnectionTest.java
Normal file
@ -0,0 +1,49 @@
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user