def test_jump_over_invalid(self): game_state = np.empty((8, 8), dtype=object) game_state[0][1] = piece.CheckersPiece(1, 0) game_state[1][2] = piece.CheckersPiece(1, 0) game_state[2][3] = piece.CheckersPiece(0, 0) game = board.CheckersGame(game_state, 1) self.assertRaises(Exception, game.move_piece, 0, 1, 2, 3)
def test_jump_collide_reverse(self): game_state = np.empty((8, 8), dtype=object) game_state[0][1] = piece.CheckersPiece(2, 0) game_state[1][2] = piece.CheckersPiece(1, 0) game_state[2][3] = piece.CheckersPiece(2, 0) game = board.CheckersGame(game_state, 2) self.assertRaises(Exception, game.move_piece, 2, 3, 0, 1)
def test_legal_board_move_reverse(self): game_state = np.empty((8, 8), dtype=object) game_state[0][1] = piece.CheckersPiece(0, 0) game_state[1][2] = piece.CheckersPiece(2, 0) game = board.CheckersGame(game_state, 2) game.move_piece(1, 2, 0, 1) self.assertEqual(game.val_at_loc(1, 2), 0) self.assertEqual(game.val_at_loc(0, 1), 2) self.assertEqual(game.player_turn(), 1)
def test_move_location_invalid(self): game_state = np.empty((8, 8), dtype=object) game_state[0][1] = piece.CheckersPiece(1, 0) game = board.CheckersGame(game_state, 1) self.assertRaises(Exception, game.move_piece, 0, 1, 1, 1)