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