Package org.scotlandyard.impl.engine.boardmap

Examples of org.scotlandyard.impl.engine.boardmap.CoordinateImpl


  @Before  //TODO add description of what the test should do
  public void setUp() throws Exception {
    latitude = 10;
    longtitude = 20;
    coordinate = new CoordinateImpl(boardMap,latitude,longtitude);
  }
View Full Code Here


    GameEngine.instance().getBoardMaps().remove("Auckland");
  }

  @Test  //TODO add description of what the test should do
  public final void testCompareTo() throws Exception{
    Coordinate coordinate2 = new CoordinateImpl(boardMap, latitude, longtitude);
    Assert.assertEquals(coordinate2.compareTo(coordinate),0);
  }
View Full Code Here

    Assert.assertEquals(coordinate2.compareTo(coordinate),0);
  }

  @Test(expected=Exception.class)//TODO add description of what the test should do
  public final void testCoordinateImpl() throws Exception{
    Coordinate c = new CoordinateImpl(null,0,0);
    assertNull(c);
  }
View Full Code Here

    assertNull(c);
  }

  @Test  //TODO add description of what the test should do
  public final void testEqualsObject() throws Exception {
    Coordinate coordinate2 = new CoordinateImpl(boardMap, latitude, longtitude);
    Assert.assertTrue(coordinate2.equals(coordinate));

    Coordinate coordinate3 = new CoordinateImpl(boardMap2, latitude, longtitude);
    Assert.assertFalse(coordinate3.equals(coordinate));
    Assert.assertFalse(coordinate3.equals(coordinate2));

    Coordinate coordinate4 = new CoordinateImpl(boardMap2, latitude, longtitude);
    Assert.assertTrue(coordinate3.equals(coordinate4));

    Assert.assertNotSame(coordinate2.getBoardMap(),coordinate3.getBoardMap());
  }
View Full Code Here

  @Test//TODO add description here
  public final void testSetPosition() throws GameException {
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("1", creator, boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap, 1.1, 2.2);
    detective.setPosition(game, coor);
    Assert.assertEquals(coor, detective.getPosition(game));
  }
View Full Code Here

  @Test//TODO add description here
  public final void testGetPosition() throws GameException {
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("2", creator, boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap, 3.3, 4.4);
    detective.setPosition(game, coor);
    Assert.assertEquals(detective.getPosition(game), coor);
  }
View Full Code Here

  @Test//TODO add description here
  public final void testMethods() throws GameException {
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("2", creator, boardMap);
    final Game game2 = GameImpl.getNewInstance("3", creator, boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap, 1.1, 2.2);
    final Coordinate coor1 = new CoordinateImpl(boardMap, 1.6, 2.6);
    //Token token = new TokenImpl(detective, TransportationMethod.BUS);
    final Link route = new LinkImpl(boardMap, TransportationMethod.BUS, coor, coor1);
    //token.setNumberOfTickets(10);

    detective.setTokens(game, TransportationMethod.BUS, 10);
View Full Code Here

  @Test
  public final void testSetPosition() throws GameException{
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("1",creator,boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap, 1.1,2.2);
    mrX.setPosition(game, coor);
    Assert.assertEquals(coor, mrX.getPosition(game));
  }
View Full Code Here

  @Test//TODO add description here
  public final void testGetPosition()throws GameException{
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("2",creator,boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap,3.3,4.4);
    mrX.setPosition(game, coor);
    Assert.assertEquals(mrX.getPosition(game), coor);

  }
View Full Code Here

    boardMap2 = BoardMapImpl.getNewInstance("Auckland");
  }

  @Before//TODO add description here
  public void setUp() throws Exception{
    a = new CoordinateImpl(boardMap, 10, 20);
    b = new CoordinateImpl(boardMap, 12, 22);
    link = new LinkImpl(boardMap, TransportationMethod.BUS, a, b);
  }
View Full Code Here

TOP

Related Classes of org.scotlandyard.impl.engine.boardmap.CoordinateImpl

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.