use of org.robolectric.annotation.SQLiteMode in project robolectric by robolectric.
the class SQLiteModeConfigurerClassTest method shouldUseRealisticShadows.
@Test
@SQLiteMode(Mode.NATIVE)
public void shouldUseRealisticShadows() {
assertThat(ConfigurationRegistry.get(Mode.class)).isSameInstanceAs(Mode.NATIVE);
try (CursorWindow cursorWindow = new CursorWindow("2")) {
ShadowCursorWindow shadow = Shadow.extract(cursorWindow);
assertThat(shadow).isInstanceOf(ShadowNativeCursorWindow.class);
}
}
use of org.robolectric.annotation.SQLiteMode in project robolectric by robolectric.
the class SQLiteModeConfigurerClassTest method shouldUseLegacyShadows.
@Test
@SQLiteMode(Mode.LEGACY)
public void shouldUseLegacyShadows() {
assertThat(ConfigurationRegistry.get(Mode.class)).isSameInstanceAs(Mode.LEGACY);
try (CursorWindow cursorWindow = new CursorWindow("1")) {
ShadowCursorWindow shadow = Shadow.extract(cursorWindow);
assertThat(shadow).isInstanceOf(ShadowLegacyCursorWindow.class);
}
}
use of org.robolectric.annotation.SQLiteMode in project robolectric by robolectric.
the class SQLiteModeConfigurerClassTest method shouldPreferCustomShadows.
@Test
@SQLiteMode(Mode.NATIVE)
@Config(shadows = MyShadowCursorWindow.class)
public void shouldPreferCustomShadows() {
assertThat(ConfigurationRegistry.get(Mode.class)).isSameInstanceAs(Mode.NATIVE);
try (CursorWindow cursorWindow = new CursorWindow("3")) {
ShadowCursorWindow shadow = Shadow.extract(cursorWindow);
assertThat(shadow).isInstanceOf(MyShadowCursorWindow.class);
}
}
Aggregations