Laget tester for BoardElementContainer

This commit is contained in:
GabrielMagnus 2020-03-12 12:06:09 +01:00
parent 7e37fbdce9
commit 9c47ed5cfe

View File

@ -0,0 +1,27 @@
package inf112.fiasko.roborally.objects;
import inf112.fiasko.roborally.element_properties.Direction;
import inf112.fiasko.roborally.element_properties.Position;
import inf112.fiasko.roborally.element_properties.TileType;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class BoardElementContainerTest {
@Test
public void getObjectTest() {
Position pos = new Position(1,2);
Tile tile = new Tile(TileType.TILE, Direction.NORTH);
BoardElementContainer<Tile> element = new BoardElementContainer<>(tile, pos);
assertEquals(tile, element.getObject());
}
@Test
public void getPositionTest() {
Position pos = new Position(1,2);
Tile tile = new Tile(TileType.TILE, Direction.NORTH);
BoardElementContainer<Tile> element = new BoardElementContainer<>(tile, pos);
assertEquals(pos, element.getPosition());
}
}