Search in sources :

Example 1 with SummaryProvider

use of com.android.settings.notification.ConfigureNotificationSettings.SummaryProvider in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ConfigureNotificationSettingsTest method getSummary_someBlocked.

@Test
public void getSummary_someBlocked() {
    SummaryLoader loader = mock(SummaryLoader.class);
    NotificationBackend backend = mock(NotificationBackend.class);
    when(backend.getBlockedAppCount()).thenReturn(5);
    SummaryProvider provider = (SummaryProvider) SUMMARY_PROVIDER_FACTORY.createSummaryProvider(mActivity, loader);
    provider.setBackend(backend);
    provider.setListening(true);
    ArgumentCaptor<CharSequence> captor = ArgumentCaptor.forClass(CharSequence.class);
    verify(loader).setSummary(any(), captor.capture());
    assertThat(captor.getValue().toString()).contains("Off");
    assertThat(captor.getValue().toString()).contains("5");
}
Also used : SummaryProvider(com.android.settings.notification.ConfigureNotificationSettings.SummaryProvider) SummaryLoader(com.android.settings.dashboard.SummaryLoader) Test(org.junit.Test)

Example 2 with SummaryProvider

use of com.android.settings.notification.ConfigureNotificationSettings.SummaryProvider in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ConfigureNotificationSettingsTest method getSummary_noneBlocked.

@Test
public void getSummary_noneBlocked() {
    SummaryLoader loader = mock(SummaryLoader.class);
    NotificationBackend backend = mock(NotificationBackend.class);
    when(backend.getBlockedAppCount()).thenReturn(0);
    SummaryProvider provider = (SummaryProvider) SUMMARY_PROVIDER_FACTORY.createSummaryProvider(mActivity, loader);
    provider.setBackend(backend);
    provider.setListening(true);
    ArgumentCaptor<CharSequence> captor = ArgumentCaptor.forClass(CharSequence.class);
    verify(loader).setSummary(any(), captor.capture());
    assertThat(captor.getValue().toString()).contains("On");
}
Also used : SummaryProvider(com.android.settings.notification.ConfigureNotificationSettings.SummaryProvider) SummaryLoader(com.android.settings.dashboard.SummaryLoader) Test(org.junit.Test)

Aggregations

SummaryLoader (com.android.settings.dashboard.SummaryLoader)2 SummaryProvider (com.android.settings.notification.ConfigureNotificationSettings.SummaryProvider)2 Test (org.junit.Test)2