use of android.app.Notification in project robolectric by robolectric.
the class ShadowNotificationBuilderTest method build_whenShowWhenNotSet_setsShowWhenOnNotificationToTrue.
@Test
@Config(minSdk = JELLY_BEAN_MR1)
public void build_whenShowWhenNotSet_setsShowWhenOnNotificationToTrue() {
Notification notification = builder.setWhen(100).setShowWhen(true).build();
assertThat(shadowOf(notification).isWhenShown()).isTrue();
}
use of android.app.Notification in project robolectric by robolectric.
the class ShadowNotificationBuilderTest method build_setsWhenOnNotification.
@Test
public void build_setsWhenOnNotification() throws Exception {
Notification notification = builder.setWhen(11L).build();
assertThat(notification.when).isEqualTo(11L);
}
use of android.app.Notification in project robolectric by robolectric.
the class ShadowNotificationBuilderTest method build_setsTickerOnNotification.
@Test
public void build_setsTickerOnNotification() throws Exception {
Notification notification = builder.setTicker("My ticker").build();
assertThat(notification.tickerText).isEqualTo("My ticker");
}
use of android.app.Notification in project robolectric by robolectric.
the class ShadowNotificationBuilderTest method build_setsUsesChronometerOnNotification_false.
@Test
@Config(minSdk = JELLY_BEAN_MR1)
public void build_setsUsesChronometerOnNotification_false() throws Exception {
Notification notification = builder.setUsesChronometer(false).setWhen(10).setShowWhen(true).build();
assertThat(shadowOf(notification).usesChronometer()).isFalse();
}
use of android.app.Notification in project robolectric by robolectric.
the class ShadowNotificationBuilderTest method build_handlesNullTicker.
@Test
public void build_handlesNullTicker() {
Notification notification = builder.setTicker(null).build();
assertThat(notification.tickerText).isNull();
}
Aggregations