Search in sources :

Example 1 with Preferences

use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.

the class TransientNotificationsControllerTest method setUp.

@Before
public void setUp() throws Exception {
    instance = new TransientNotificationsController(uiService, preferencesService);
    Preferences preferences = new Preferences();
    notificationPrefs = preferences.getNotification();
    when(preferencesService.getPreferences()).thenReturn(preferences);
    loadFxml("theme/transient_notifications.fxml", clazz -> instance);
}
Also used : Preferences(com.faforever.client.preferences.Preferences) Before(org.junit.Before)

Example 2 with Preferences

use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.

the class GamesTilesContainerControllerTest method setUp.

@Before
public void setUp() throws Exception {
    instance = new GamesTilesContainerController(uiService, preferencesService);
    when(uiService.loadFxml("theme/play/game_card.fxml")).thenReturn(gameTileController);
    preferences = new Preferences();
    when(preferencesService.getPreferences()).thenReturn(preferences);
    when(gameTileController.getRoot()).thenReturn(new Pane()).thenReturn(new FlowPane()).thenReturn(new StackPane());
    loadFxml("theme/play/games_tiles_container.fxml", clazz -> instance);
}
Also used : FlowPane(javafx.scene.layout.FlowPane) Preferences(com.faforever.client.preferences.Preferences) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane) FlowPane(javafx.scene.layout.FlowPane) StackPane(javafx.scene.layout.StackPane) Before(org.junit.Before)

Example 3 with Preferences

use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.

the class GamesTableControllerTest method setUp.

@Before
public void setUp() throws Exception {
    instance = new GamesTableController(mapService, joinGameHelper, i18n, uiService, preferencesService);
    when(preferencesService.getPreferences()).thenReturn(new Preferences());
    loadFxml("theme/play/games_table.fxml", param -> instance);
    Platform.runLater(() -> getRoot().getChildren().addAll(instance.getRoot()));
    WaitForAsyncUtils.waitForFxEvents();
}
Also used : Preferences(com.faforever.client.preferences.Preferences) Before(org.junit.Before)

Example 4 with Preferences

use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.

the class LoginControllerTest method setUp.

@Before
public void setUp() throws Exception {
    ClientProperties clientProperties = new ClientProperties();
    instance = new LoginController(userService, preferencesService, platformService, clientProperties);
    loadFxml("theme/login.fxml", param -> instance);
    Website website = clientProperties.getWebsite();
    website.setCreateAccountUrl("create");
    website.setForgotPasswordUrl("forgot");
    when(preferencesService.getPreferences()).thenReturn(new Preferences());
}
Also used : ClientProperties(com.faforever.client.config.ClientProperties) Website(com.faforever.client.config.ClientProperties.Website) Preferences(com.faforever.client.preferences.Preferences) Before(org.junit.Before)

Example 5 with Preferences

use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.

the class ModVaultControllerTest method setUp.

@Before
public void setUp() throws Exception {
    when(preferencesService.getPreferences()).thenReturn(new Preferences());
    instance = new ModVaultController(modService, i18n, eventBus, preferencesService, uiService, notificationService);
    doAnswer(invocation -> {
        ModCardController modCardController = mock(ModCardController.class);
        when(modCardController.getRoot()).then(invocation1 -> new Pane());
        return modCardController;
    }).when(uiService).loadFxml("theme/vault/mod/mod_card.fxml");
    doAnswer(invocation -> {
        modDetailController = mock(ModDetailController.class);
        when(modDetailController.getRoot()).then(invocation1 -> new Pane());
        return modDetailController;
    }).when(uiService).loadFxml("theme/vault/mod/mod_detail.fxml");
    ModVersion modVersion = ModInfoBeanBuilder.create().defaultValues().get();
    when(modService.getHighestRatedMods(100, 1)).thenReturn(CompletableFuture.completedFuture(Collections.singletonList(modVersion)));
    when(modService.getNewestMods(100, 1)).thenReturn(CompletableFuture.completedFuture(Collections.singletonList(modVersion)));
    loadFxml("theme/vault/mod/mod_vault.fxml", clazz -> {
        if (clazz == LogicalNodeController.class) {
            return logicalNodeController;
        }
        if (clazz == SearchController.class) {
            return searchController;
        }
        if (clazz == SpecificationController.class) {
            return specificationController;
        }
        return instance;
    });
}
Also used : Preferences(com.faforever.client.preferences.Preferences) Pane(javafx.scene.layout.Pane) Before(org.junit.Before)

Aggregations

Preferences (com.faforever.client.preferences.Preferences)21 Before (org.junit.Before)16 Pane (javafx.scene.layout.Pane)6 ClientProperties (com.faforever.client.config.ClientProperties)3 Clan (com.faforever.client.clan.Clan)2 Vault (com.faforever.client.config.ClientProperties.Vault)2 NumberFormat (java.text.NumberFormat)2 TabPane (javafx.scene.control.TabPane)2 NumberStringConverter (javafx.util.converter.NumberStringConverter)2 ChatColorMode (com.faforever.client.chat.ChatColorMode)1 AvatarBean (com.faforever.client.chat.avatar.AvatarBean)1 ClanTooltipController (com.faforever.client.clan.ClanTooltipController)1 Website (com.faforever.client.config.ClientProperties.Website)1 Controller (com.faforever.client.fx.Controller)1 PATH_STRING_CONVERTER (com.faforever.client.fx.JavaFxUtil.PATH_STRING_CONVERTER)1 StringListCell (com.faforever.client.fx.StringListCell)1 Game (com.faforever.client.game.Game)1 I18n (com.faforever.client.i18n.I18n)1 Action (com.faforever.client.notification.Action)1 NotificationService (com.faforever.client.notification.NotificationService)1