Package es.mahulo.battleship.model

Examples of es.mahulo.battleship.model.Game


    gameServer.addShip(1L,"manuel", ships1);
   
  }
 
  @Test public void shotHitTest() throws Exception {
    Game game = gameServer.startUp("manuel");
    game = gameServer.joinPlayer(game.getId(), "maeve");

    gameServer.addShip(1L,"manuel", ships1);
    gameServer.addShip(1L,"maeve", ships2);
   
    Shot shot = new Shot();
View Full Code Here


   
    Assert.assertTrue(hit);
  }
 
  @Test public void shotNoHitTest() throws Exception {
    Game game = gameServer.startUp("manuel");
    game = gameServer.joinPlayer(game.getId(), "maeve");

    gameServer.addShip(1L,"manuel", ships1);
    gameServer.addShip(1L,"maeve", ships2);
   
    Shot shot = new Shot();
View Full Code Here

   
    Assert.assertFalse(hit);
  }
 
  @Test public void wind1Test() throws Exception {
    Game game = gameServer.startUp("manuel");
    game = gameServer.joinPlayer(game.getId(), "maeve");

    gameServer.addShip(1L,"manuel", ships1);
    gameServer.addShip(1L,"maeve", ships2);
   
    shotShip1(gameServer,cellShip1);
    shotShip1(gameServer,cellShip2);
    shotShip1(gameServer,cellShip3);
    shotShip1(gameServer,cellShip4);
    shotShip1(gameServer,cellShip5);
    shotShip1(gameServer,cellShip6);
    shotShip1(gameServer,cellShip7);
   

    Assert.assertEquals(GameStatus.Wind1, game.getStatus());
   
  }
View Full Code Here

    Assert.assertEquals(GameStatus.Wind1, game.getStatus());
   
  }
 
  @Test public void wind2Test() throws Exception {
    Game game = gameServer.startUp("manuel");
    game = gameServer.joinPlayer(game.getId(), "maeve");

    gameServer.addShip(1L,"manuel", ships1);
    gameServer.addShip(1L,"maeve", ships2);
   
    shotShip2(gameServer,cellShip1);
    shotShip2(gameServer,cellShip2);
    shotShip2(gameServer,cellShip3);
    shotShip2(gameServer,cellShip4);
    shotShip2(gameServer,cellShip5);
    shotShip2(gameServer,cellShip6);
    shotShip2(gameServer,cellShip7);
   

    Assert.assertEquals(GameStatus.Wind2, game.getStatus());
   

   
  }
View Full Code Here

   
  }


  @Test public void drawTest() throws Exception {
    Game game = gameServer.startUp("manuel");
    game = gameServer.joinPlayer(game.getId(), "maeve");

    gameServer.addShip(1L,"manuel", ships1);
    gameServer.addShip(1L,"maeve", ships2);
   
    shotShipDraw(gameServer,cellShip1);
    shotShipDraw(gameServer,cellShip1);
    shotShipDraw(gameServer,cellShip2);
    shotShipDraw(gameServer,cellShip3);
    shotShipDraw(gameServer,cellShip4);
    shotShipDraw(gameServer,cellShip5);
    shotShipDraw(gameServer,cellShip6);
    shotShipDraw(gameServer,cellShip7);

    Assert.assertEquals(GameStatus.Draw, game.getStatus());
   
  }
View Full Code Here

TOP

Related Classes of es.mahulo.battleship.model.Game

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.