use of com.pushtorefresh.storio3.sqlite.StorIOSQLite in project storio by pushtorefresh.
the class SchedulerChecker method check.
private void check(@NonNull PreparedOperation operation) {
final PreparedOperation operationSpy = spy(operation);
verify(storIOSQLite).defaultRxScheduler();
operationSpy.asRxFlowable(MISSING).subscribe();
verify(operationSpy, never()).executeAsBlocking();
scheduler.triggerActions();
verify(operationSpy).executeAsBlocking();
}
use of com.pushtorefresh.storio3.sqlite.StorIOSQLite in project storio by pushtorefresh.
the class DeleteOperationDesignTest method deleteObjectBlocking.
@Test
public void deleteObjectBlocking() {
User user = newUser();
DeleteResult deleteResult = storIOSQLite().delete().object(user).withDeleteResolver(UserTableMeta.DELETE_RESOLVER).prepare().executeAsBlocking();
}
use of com.pushtorefresh.storio3.sqlite.StorIOSQLite in project storio by pushtorefresh.
the class PutOperationDesignTest method putObjectBlocking.
@Test
public void putObjectBlocking() {
User user = newUser();
PutResult putResult = storIOSQLite().put().object(user).withPutResolver(UserTableMeta.PUT_RESOLVER).prepare().executeAsBlocking();
}
use of com.pushtorefresh.storio3.sqlite.StorIOSQLite in project storio by pushtorefresh.
the class DefaultStorIOSQLiteTest method defaultSchedulerReturnsSpecifiedScheduler.
@Test
public void defaultSchedulerReturnsSpecifiedScheduler() {
Scheduler scheduler = mock(Scheduler.class);
StorIOSQLite storIOSQLite = DefaultStorIOSQLite.builder().sqliteOpenHelper(sqLiteOpenHelper).defaultRxScheduler(scheduler).build();
assertThat(storIOSQLite.defaultRxScheduler()).isSameAs(scheduler);
}
use of com.pushtorefresh.storio3.sqlite.StorIOSQLite in project storio by pushtorefresh.
the class DefaultStorIOSQLiteTest method typeMappingShouldWorkWithSpecifiedTypeMappingFinder.
@Test
public void typeMappingShouldWorkWithSpecifiedTypeMappingFinder() {
TypeMappingFinder typeMappingFinder = new TypeMappingFinderImpl();
// noinspection unchecked
SQLiteTypeMapping<ClassEntity> typeMapping = SQLiteTypeMapping.builder().putResolver(mock(PutResolver.class)).getResolver(mock(GetResolver.class)).deleteResolver(mock(DeleteResolver.class)).build();
DefaultStorIOSQLite storIOSQLite = DefaultStorIOSQLite.builder().sqliteOpenHelper(sqLiteOpenHelper).typeMappingFinder(typeMappingFinder).addTypeMapping(ClassEntity.class, typeMapping).build();
assertThat(storIOSQLite.lowLevel().typeMapping(ClassEntity.class)).isEqualTo(typeMapping);
}
Aggregations