예제 #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");
    }
  }
예제 #2
0
 @Before
 public void setup() {
   // By default, blue moves first.
   testGame = factory.makeHantoTestGame(HantoGameID.DELTA_HANTO);
   game = testGame;
 }
예제 #3
0
 @BeforeClass
 public static void initializeClass() {
   factory = HantoTestGameFactory.getInstance();
 }