mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-02-01 07:39:35 +01:00
Made tests for the position.equals method.
This commit is contained in:
parent
61ec28f6ad
commit
726efa3cb4
@ -1,23 +1,35 @@
|
|||||||
package inf112.fiasko.roborally.element_properties;
|
package inf112.fiasko.roborally.element_properties;
|
||||||
|
|
||||||
import inf112.fiasko.roborally.element_properties.Position;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
public class PositionTest {
|
public class PositionTest {
|
||||||
private Position testPosition;
|
private Position testPosition1;
|
||||||
|
private Position testPosition2;
|
||||||
|
private Position testPosition3;
|
||||||
|
private Position testPosition4;
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
testPosition = new Position(3, 4);
|
testPosition1 = new Position(3, 4);
|
||||||
|
testPosition2 = new Position(2, 3);
|
||||||
|
testPosition3 = new Position(3, 4);
|
||||||
|
testPosition4 = new Position(3, 3);
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void testGetXPosition(){
|
public void testGetXPosition(){
|
||||||
assertEquals(3,testPosition.getXCoordinate());
|
assertEquals(3,testPosition1.getXCoordinate());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetYPosition(){
|
public void testGetYPosition(){
|
||||||
assertEquals(4,testPosition.getYCoordinate());
|
assertEquals(4,testPosition1.getYCoordinate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSamePositionsAreEqual() { assertEquals(testPosition1, testPosition3);}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDifferentPositionsAreNotEqual() { assertNotEquals(testPosition2, testPosition4);}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user