use of org.robolectric.annotation.Config in project robolectric by robolectric.
the class ShadowNotificationBuilderTest method build_setsIconOnNotification.
@Test
@Config(minSdk = M)
public void build_setsIconOnNotification() throws Exception {
Notification notification = builder.setSmallIcon(R.drawable.an_image).build();
assertThat(notification.getSmallIcon().getResId()).isEqualTo(R.drawable.an_image);
}
use of org.robolectric.annotation.Config in project robolectric by robolectric.
the class ShadowNotificationBuilderTest method build_setsUsesChronometerOnNotification_true.
@Test
@Config(minSdk = JELLY_BEAN_MR1)
public void build_setsUsesChronometerOnNotification_true() throws Exception {
Notification notification = builder.setUsesChronometer(true).setWhen(10).setShowWhen(true).build();
assertThat(shadowOf(notification).usesChronometer()).isTrue();
}
use of org.robolectric.annotation.Config 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 org.robolectric.annotation.Config 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 org.robolectric.annotation.Config in project robolectric by robolectric.
the class ShadowNotificationBuilderTest method withBigPictureStyle.
@Test
@Config(minSdk = M)
public void withBigPictureStyle() {
Bitmap bigPicture = BitmapFactory.decodeResource(RuntimeEnvironment.application.getResources(), R.drawable.an_image);
Icon bigLargeIcon = Icon.createWithBitmap(bigPicture);
Notification notification = builder.setStyle(new Notification.BigPictureStyle(builder).bigPicture(bigPicture).bigLargeIcon(bigLargeIcon)).build();
assertThat(shadowOf(notification).getBigPicture()).isEqualTo(bigPicture);
}
Aggregations