Ejemplo n.º 1
0
 @Test
 public void testIsInOmino() {
   assertTrue(testPiece.isInOmino(new Tile(0, 1), Tile.ZERO));
   assertTrue(testPiece.isInOmino(new Tile(1, 0), Tile.ZERO));
   assertFalse(testPiece.isInOmino(new Tile(2, 2), Tile.ZERO));
   assertTrue(testPiece.isInOmino(new Tile(2, 2), new Tile(2, 2)));
 }
Ejemplo n.º 2
0
 @Test
 public void testBorders() {
   Set<Tile> border = testPiece.getBorderUp();
   assertTrue(border.contains(new Tile(0, 2)));
   border = testPiece.getBorderDown();
   assertTrue(border.contains(new Tile(1, -1)));
   border = testPiece.getBorderLeft();
   assertTrue(border.contains(new Tile(-1, 0)));
   border = testPiece.getBorderRight();
   assertTrue(border.contains(new Tile(1, 1)));
 }
Ejemplo n.º 3
0
 @Test
 public void testgetShape() {
   Set<Tile> shape = testPiece.getShape();
   assertTrue(shape.contains(Tile.UP));
   assertTrue(shape.contains(Tile.RIGHT));
   assertTrue(shape.contains(Tile.ZERO));
   assertFalse(shape.contains(Tile.LEFT));
 }
Ejemplo n.º 4
0
 @Test
 public void testLayoutHash() {
   Omino newOmino = new Omino(testPiece);
   assertTrue(
       "Error: Layout Hashes not equal!", newOmino.getLayoutHash() == testPiece.getLayoutHash());
 }