Esempio n. 1
0
  @Test
  public void test1() {
    HantoTestGame game =
        HantoTestGameFactory.getInstance().makeHantoTestGame(HantoGameID.GAMMA_HANTO);

    try {
      MoveResult result = game.makeMove(HantoPieceType.BUTTERFLY, null, new BasicCoordinate(0, 0));
      assertEquals(MoveResult.OK, result);
      result = game.makeMove(HantoPieceType.BUTTERFLY, null, new BasicCoordinate(0, 1));
      assertEquals(MoveResult.OK, result);
      result = game.makeMove(HantoPieceType.SPARROW, null, new BasicCoordinate(1, 0));
      fail("should have gotten exception");

    } catch (HantoException e) {
      assertEquals(e.getMessage(), "Piece placed next to opposite color");
    }
  }
 @Before
 public void setup() {
   // By default, blue moves first.
   testGame = factory.makeHantoTestGame(HantoGameID.DELTA_HANTO);
   game = testGame;
 }
 @BeforeClass
 public static void initializeClass() {
   factory = HantoTestGameFactory.getInstance();
 }