use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class HotspotConditionControllerTest method buildContextualCard_hasWifiAp_shouldHaveWifiApSsid.
@Test
public void buildContextualCard_hasWifiAp_shouldHaveWifiApSsid() {
setupWifiApConfiguration();
final ContextualCard card = mController.buildContextualCard();
assertThat(card.getSummaryText()).isEqualTo(WIFI_AP_SSID);
}
use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LegacySuggestionContextualCardControllerTest method onDismiss_shouldRemoveSuggestionFromList.
@Test
public void onDismiss_shouldRemoveSuggestionFromList() {
mController.setCardUpdateListener(mCardUpdateListener);
mController.mSuggestions.add(buildContextualCard("test1"));
final ContextualCard card2 = buildContextualCard("test2");
mController.mSuggestions.add(card2);
assertThat(mController.mSuggestions).hasSize(2);
mController.onDismissed(card2);
assertThat(mController.mSuggestions).hasSize(1);
}
use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LegacySuggestionContextualCardControllerTest method onDismiss_shouldCallUpdateAdapter.
@Test
public void onDismiss_shouldCallUpdateAdapter() {
mController.setCardUpdateListener(mCardUpdateListener);
final ContextualCard card = buildContextualCard("test1");
mController.mSuggestions.add(card);
mController.onDismissed(card);
verify(mCardUpdateListener).onContextualCardUpdated(anyMap());
}
use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ConditionContextualCardControllerTest method onConditionsChanged_listenerNotSet_shouldNotUpdateData.
@Test
public void onConditionsChanged_listenerNotSet_shouldNotUpdateData() {
final ContextualCard fakeConditionalCard = new ConditionalContextualCard.Builder().build();
final List<ContextualCard> conditionalCards = new ArrayList<>();
conditionalCards.add(fakeConditionalCard);
when(mConditionManager.getDisplayableCards()).thenReturn(conditionalCards);
mController.onConditionsChanged();
verify(mListener, never()).onContextualCardUpdated(any());
}
use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ConditionContextualCardControllerTest method onConditionsChanged_listenerIsSet_shouldUpdateData.
@Test
public void onConditionsChanged_listenerIsSet_shouldUpdateData() {
final ContextualCard fakeConditionalCard = new ConditionalContextualCard.Builder().build();
final List<ContextualCard> conditionalCards = new ArrayList<>();
conditionalCards.add(fakeConditionalCard);
when(mConditionManager.getDisplayableCards()).thenReturn(conditionalCards);
mController.setCardUpdateListener(mListener);
mController.onConditionsChanged();
verify(mListener).onContextualCardUpdated(any());
}
Aggregations