Search in sources :

Example 31 with Player

use of com.faforever.client.player.Player in project downlords-faf-client by FAForever.

the class AbstractChatTabControllerTest method testPlayerInfo.

@Test
public void testPlayerInfo() throws Exception {
    String playerName = "somePlayer";
    Player player = new Player(playerName);
    when(playerService.getPlayerForUsername(playerName)).thenReturn(player);
    WaitForAsyncUtils.waitForAsyncFx(TIMEOUT, () -> instance.playerInfo(playerName));
    verify(playerService).getPlayerForUsername(playerName);
}
Also used : Player(com.faforever.client.player.Player) Matchers.emptyString(org.hamcrest.Matchers.emptyString) Test(org.junit.Test) AbstractPlainJavaFxTest(com.faforever.client.test.AbstractPlainJavaFxTest)

Example 32 with Player

use of com.faforever.client.player.Player in project downlords-faf-client by FAForever.

the class AbstractChatTabControllerTest method testHidePlayerInfo.

@Test
public void testHidePlayerInfo() throws Exception {
    String playerName = "somePlayer";
    Player player = new Player(playerName);
    when(playerService.getPlayerForUsername(playerName)).thenReturn(player);
    WaitForAsyncUtils.waitForAsyncFx(TIMEOUT, () -> {
        instance.playerInfo(playerName);
        instance.hidePlayerInfo();
    });
// I don't see what could be verified here
}
Also used : Player(com.faforever.client.player.Player) Matchers.emptyString(org.hamcrest.Matchers.emptyString) Test(org.junit.Test) AbstractPlainJavaFxTest(com.faforever.client.test.AbstractPlainJavaFxTest)

Example 33 with Player

use of com.faforever.client.player.Player in project downlords-faf-client by FAForever.

the class AbstractChatTabControllerTest method getMessageCssClassFriend.

@Test
public void getMessageCssClassFriend() throws Exception {
    String playerName = "somePlayer";
    Player player = new Player(playerName);
    player.setSocialStatus(FRIEND);
    when(playerService.getPlayerForUsername(playerName)).thenReturn(player);
    assertEquals(instance.getMessageCssClass(playerName), SocialStatus.FRIEND.getCssClass());
}
Also used : Player(com.faforever.client.player.Player) Matchers.emptyString(org.hamcrest.Matchers.emptyString) Test(org.junit.Test) AbstractPlainJavaFxTest(com.faforever.client.test.AbstractPlainJavaFxTest)

Example 34 with Player

use of com.faforever.client.player.Player in project downlords-faf-client by FAForever.

the class AbstractChatTabControllerTest method getMessageCssClassSelf.

@Test
public void getMessageCssClassSelf() throws Exception {
    String playerName = "junit";
    Player player = new Player(playerName);
    player.setSocialStatus(SELF);
    player.setChatOnly(false);
    when(playerService.getPlayerForUsername(playerName)).thenReturn(player);
    assertEquals(instance.getMessageCssClass(playerName), SocialStatus.SELF.getCssClass());
}
Also used : Player(com.faforever.client.player.Player) Matchers.emptyString(org.hamcrest.Matchers.emptyString) Test(org.junit.Test) AbstractPlainJavaFxTest(com.faforever.client.test.AbstractPlainJavaFxTest)

Example 35 with Player

use of com.faforever.client.player.Player in project downlords-faf-client by FAForever.

the class AbstractChatTabControllerTest method getMessageCssClassFoe.

@Test
public void getMessageCssClassFoe() throws Exception {
    String playerName = "somePlayer";
    Player player = new Player(playerName);
    player.setSocialStatus(FOE);
    when(playerService.getPlayerForUsername(playerName)).thenReturn(player);
    assertEquals(instance.getMessageCssClass(playerName), SocialStatus.FOE.getCssClass());
}
Also used : Player(com.faforever.client.player.Player) Matchers.emptyString(org.hamcrest.Matchers.emptyString) Test(org.junit.Test) AbstractPlainJavaFxTest(com.faforever.client.test.AbstractPlainJavaFxTest)

Aggregations

Player (com.faforever.client.player.Player)51 AbstractPlainJavaFxTest (com.faforever.client.test.AbstractPlainJavaFxTest)17 Test (org.junit.Test)17 Pane (javafx.scene.layout.Pane)8 I18n (com.faforever.client.i18n.I18n)7 PlayerService (com.faforever.client.player.PlayerService)7 UiService (com.faforever.client.theme.UiService)7 ClientProperties (com.faforever.client.config.ClientProperties)6 Controller (com.faforever.client.fx.Controller)6 ArrayList (java.util.ArrayList)6 Platform (javafx.application.Platform)6 Node (javafx.scene.Node)6 Scope (org.springframework.context.annotation.Scope)6 Component (org.springframework.stereotype.Component)6 JavaFxUtil (com.faforever.client.fx.JavaFxUtil)5 NotificationService (com.faforever.client.notification.NotificationService)5 TimeService (com.faforever.client.util.TimeService)5 Collection (java.util.Collection)5 List (java.util.List)5 Map (java.util.Map)5