Example #1
0
 @Test
 public void coordinatesTooMuchRightAreOffTheGrid() {
   assertEquals(null, grid.getSquareFromCoordinates(155, 400));
 }
Example #2
0
 @Test
 public void coordinatesTooMuchDownAreOffTheGrid() {
   assertEquals(null, grid.getSquareFromCoordinates(1000, 20));
 }
Example #3
0
 @Test
 public void coordinatesTooMuchLeftAreOffTheGrid() {
   assertEquals(null, grid.getSquareFromCoordinates(150, -202));
 }
Example #4
0
 @Test
 public void findBottomRightSquareFromPixelCoordinates() {
   assertEquals(new Point(9, 9), grid.getSquareFromCoordinates(300, 329));
 }
Example #5
0
 @Test
 public void findBottomLeftSquareFromPixelCoordinates() {
   assertEquals(new Point(9, 0), grid.getSquareFromCoordinates(329, 32));
 }
Example #6
0
 @Test
 public void findTopRightSquareFromPixelCoordinates() {
   assertEquals(new Point(0, 9), grid.getSquareFromCoordinates(10, 329));
 }
Example #7
0
 @Test
 public void findTopLeftSquareFromPixelCoordinates() {
   assertEquals(new Point(0, 0), grid.getSquareFromCoordinates(1, 30));
 }
Example #8
0
 @Before
 public void setUp() {
   grid = new VisualGrid(new Laivanupotus());
   grid.getGame().setGameState(1);
 }