Package modelo.excepciones

Examples of modelo.excepciones.ExcepcionPosicionNoValida


  @Test
  public final void tesExcepcionPosicionNoValida() {
    Coordenada c=null;
    try {
      c = new Coordenada('D', 2);
      throw new ExcepcionPosicionNoValida(c);
    } catch (Exception ex) {
      if (ex instanceof ExcepcionPosicionNoValida)
        assertEquals(c,((ExcepcionPosicionNoValida) ex).getCoordenada());
      else fail("Se esperaba ExcepcionPosicionNoValida, pero se capturo "+ex.getClass().getSimpleName());
    }
View Full Code Here


      Casilla cas= PartidaAjedrez.getInstancia().getTablero().getCasillaAt(coor);
     
      if(cas==null)
        throw new ExcepcionCoordenadaErronea(coor.getLetra(), coor.getY());
      else if(cas!=null && cas.isOcupada())
        throw new ExcepcionPosicionNoValida(coor);
      else
      {
        tablero.colocaPiezaAt(cas.getCoordenada(), coloca);
        piezas.add(coloca);
      }
View Full Code Here

TOP

Related Classes of modelo.excepciones.ExcepcionPosicionNoValida

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.