Examples of CoordinateImpl


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

    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

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

  @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

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

  @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

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

  @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

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

  @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

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

  @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

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

    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

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

  public final void testEqualsObject() throws GameException{
    Link other = new LinkImpl(boardMap, TransportationMethod.BUS, a, b);
    Assert.assertTrue(link.equals(other));
    Link other2 = new LinkImpl(boardMap, TransportationMethod.TAXI, a, b);
    Assert.assertFalse(link.equals(other2));
    Link other3 = new LinkImpl(boardMap, TransportationMethod.BUS, a, new CoordinateImpl(boardMap,11,22));
    Assert.assertFalse(link.equals(other3));
    Link other4 = new LinkImpl(boardMap, TransportationMethod.BUS, new CoordinateImpl(boardMap,11,20), b);
    Assert.assertFalse(link.equals(other4));
  }
View Full Code Here

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

  @Test(expected=Exception.class)//TODO add description here
  public final void testLinkImpl2() throws Exception{
    Assert.assertNull(new LinkImpl(
        null,
        TransportationMethod.BUS,
        new CoordinateImpl(boardMap, 2, 2),
        new CoordinateImpl(boardMap, 1, 1)
    ));
   
  }
View Full Code Here

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

  @Test(expected=Exception.class)//TODO add description here
  public final void testLinkImpl3() throws Exception{
    Assert.assertNull(new LinkImpl(
        boardMap,
        null,
        new CoordinateImpl(boardMap, 2, 2),
        new CoordinateImpl(boardMap, 1, 1)
    ));
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.