예제 #1
0
  @Test
  public void isCorrectPlayerInGameNoPlayer() {
    when(service.isAuthorized(anyString())).thenReturn(true);
    when(service.getUserBySession(anyString())).thenReturn(null);

    assertFalse(gameServer.isCorrectPlayerInGame("aa"));
  }
예제 #2
0
  @Test
  public void testIsCorrectPlayerInGameAlready() throws Exception {
    when(service.isAuthorized(anyString())).thenReturn(true);
    UserProfile profile = new UserProfile("test", "test");
    Room room = new RoomFFA("testRoom");
    profile.setCurrentroom(room);
    when(service.getUserBySession(anyString())).thenReturn(profile);

    assertTrue(gameServer.isCorrectPlayerInGame("aa"));
  }
예제 #3
0
  @Test
  public void testIsCorrectPlayerInGameNoAuth() throws Exception {
    when(service.isAuthorized(anyString())).thenReturn(false);

    assertFalse(gameServer.isCorrectPlayerInGame("aa"));
  }