Package org.jpacman.framework.model

Examples of org.jpacman.framework.model.Game.addObserver()


   */
  @Test
  public void testObserverAfterPlayerMove() throws FactoryException {
    Observer anObserver = mock(Observer.class);
    Game g = makePlay("P #");
    g.addObserver(anObserver);
   
    g.movePlayer(Direction.RIGHT);
    verify(anObserver).update(any(Observable.class), anyObject());
  }
 
View Full Code Here


  @Test
  public void testObserverAfterGhostMove() throws FactoryException {
    // given
    Observer anObserver = mock(Observer.class);
    Game game = makePlay("G #");
    game.addObserver(anObserver);
    Ghost ghost = (Ghost) game.getBoard().spriteAt(0, 0);
    // when
    game.moveGhost(ghost, Direction.RIGHT);
    // then
    verify(anObserver).update(any(Observable.class), anyObject());
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.