Package ch.fusun.baron.player

Examples of ch.fusun.baron.player.PlayerServiceImpl


    Player player1 = new Player(0, "player1", Gender.MALE); //$NON-NLS-1$
    dynasty.addPlayer(player1);
    Player player2 = new Player(1, "player2", Gender.FEMALE); //$NON-NLS-1$
    dynasty.addPlayer(player2);

    PlayerService service = new PlayerServiceImpl();
    assertNotNull(service.getAllPlayers());

    assertEquals(service.getDynasty(user), null);
    service.setDynastyForUser(dynasty, user);
    assertTrue(service.getDynasty(user) == dynasty);

    List<Player> players = service.getPlayers(user);
    assertNotNull(players);
    assertEquals(2, players.size());
    assertTrue(players.contains(player1));
    assertTrue(players.contains(player2));

    service.setDynastyForUser(dynasty2, user2);
    List<Dynasty> allDynasties = service.getAllDynasties();
    assertEquals(2, allDynasties.size());
    assertTrue(allDynasties.contains(dynasty));
    assertTrue(allDynasties.contains(dynasty2));
  }
View Full Code Here

TOP

Related Classes of ch.fusun.baron.player.PlayerServiceImpl

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.