use of org.robolectric.annotation.Config in project robolectric by robolectric.
the class ParallelUniverseTest method setUpApplicationState_setsVersionQualifierFromConfigQualifiers.
@Test
public void setUpApplicationState_setsVersionQualifierFromConfigQualifiers() {
String givenQualifiers = "land-v17";
Config c = new Config.Builder().setQualifiers(givenQualifiers).build();
setUpApplicationState(c);
assertThat(RuntimeEnvironment.getQualifiers()).contains("land-v17");
}
use of org.robolectric.annotation.Config in project robolectric by robolectric.
the class ParallelUniverseTest method setUpApplicationState_setsVersionQualifierFromSdkConfigWithOtherQualifiers.
@Test
public void setUpApplicationState_setsVersionQualifierFromSdkConfigWithOtherQualifiers() {
String givenQualifiers = "large-land";
Config c = new Config.Builder().setQualifiers(givenQualifiers).build();
setUpApplicationState(c);
assertThat(RuntimeEnvironment.getQualifiers()).contains("large-land-v18");
}
use of org.robolectric.annotation.Config in project robolectric by robolectric.
the class ParallelUniverseTest method setUpApplicationState_setsVersionQualifierFromSdkConfig.
@Test
public void setUpApplicationState_setsVersionQualifierFromSdkConfig() {
String givenQualifiers = "";
Config c = new Config.Builder().setQualifiers(givenQualifiers).build();
setUpApplicationState(c);
assertThat(RuntimeEnvironment.getQualifiers()).contains("v18");
}
use of org.robolectric.annotation.Config in project robolectric by robolectric.
the class ShadowDateUtilsTest method formatDateTime_withCurrentYear_worksPreKitKat.
@Test
@Config(maxSdk = JELLY_BEAN_MR2)
public void formatDateTime_withCurrentYear_worksPreKitKat() {
Calendar calendar = Calendar.getInstance();
final int currentYear = calendar.get(Calendar.YEAR);
final long millisAtStartOfYear = getMillisAtStartOfYear();
String actual = DateUtils.formatDateTime(RuntimeEnvironment.application, millisAtStartOfYear, DateUtils.FORMAT_NUMERIC_DATE);
assertThat(actual).isEqualTo("1/1/" + currentYear);
}
use of org.robolectric.annotation.Config in project robolectric by robolectric.
the class ShadowDrawableTest method testGetBitmapOrVectorDrawableAt19.
@Test
@Config(minSdk = KITKAT)
public void testGetBitmapOrVectorDrawableAt19() {
final Drawable aDrawable = RuntimeEnvironment.application.getResources().getDrawable(R.drawable.an_image_or_vector);
assertThat(aDrawable).isInstanceOf(BitmapDrawable.class);
}
Aggregations