use of org.robolectric.internal.SdkConfig in project robolectric by robolectric.
the class SdkPickerTest method withMinSdkConfig_shouldClipSdkRangeFromAndroidManifest.
@Test
public void withMinSdkConfig_shouldClipSdkRangeFromAndroidManifest() throws Exception {
when(appManifest.getTargetSdkVersion()).thenReturn(22);
when(appManifest.getMinSdkVersion()).thenReturn(19);
when(appManifest.getMaxSdkVersion()).thenReturn(23);
assertThat(sdkPicker.selectSdks(new Config.Builder().setMinSdk(21).build(), appManifest)).containsExactly(new SdkConfig(21), new SdkConfig(22), new SdkConfig(23));
}
use of org.robolectric.internal.SdkConfig in project robolectric by robolectric.
the class SdkPickerTest method withEnabledSdkNames_shouldRestrictAsSpecified.
@Test
public void withEnabledSdkNames_shouldRestrictAsSpecified() throws Exception {
when(appManifest.getMinSdkVersion()).thenReturn(16);
when(appManifest.getMaxSdkVersion()).thenReturn(23);
properties.setProperty("robolectric.enabledSdks", "KITKAT, LOLLIPOP");
assertThat(sdkPicker.selectSdks(new Config.Builder().setSdk(Config.ALL_SDKS).build(), appManifest)).containsExactly(new SdkConfig(19), new SdkConfig(21));
}
use of org.robolectric.internal.SdkConfig in project robolectric by robolectric.
the class SdkPickerTest method withMaxSdkConfig_shouldUseSdkRangeFromAndroidManifest.
@Test
public void withMaxSdkConfig_shouldUseSdkRangeFromAndroidManifest() throws Exception {
when(appManifest.getTargetSdkVersion()).thenReturn(22);
when(appManifest.getMinSdkVersion()).thenReturn(19);
when(appManifest.getMaxSdkVersion()).thenReturn(23);
assertThat(sdkPicker.selectSdks(new Config.Builder().setMaxSdk(21).build(), appManifest)).containsExactly(new SdkConfig(19), new SdkConfig(21));
}
use of org.robolectric.internal.SdkConfig in project robolectric by robolectric.
the class SdkPickerTest method withEnabledSdks_shouldRestrictAsSpecified.
@Test
public void withEnabledSdks_shouldRestrictAsSpecified() throws Exception {
when(appManifest.getMinSdkVersion()).thenReturn(16);
when(appManifest.getMaxSdkVersion()).thenReturn(23);
properties.setProperty("robolectric.enabledSdks", "17,18");
assertThat(sdkPicker.selectSdks(new Config.Builder().setSdk(Config.ALL_SDKS).build(), appManifest)).containsExactly(new SdkConfig(17), new SdkConfig(18));
}
Aggregations