use of com.pushtorefresh.storio.sqlite.operations.delete.DeleteResult in project storio by pushtorefresh.
the class AutoParcelTest method deleteObject.
@Test
public void deleteObject() {
final Book book = Book.builder().id(1).title("What a great book").author("Somebody").build();
final PutResult putResult = storIOSQLite.put().object(book).prepare().executeAsBlocking();
assertThat(putResult.wasInserted()).isTrue();
final DeleteResult deleteResult = storIOSQLite.delete().object(book).prepare().executeAsBlocking();
assertThat(deleteResult.numberOfRowsDeleted()).isEqualTo(1);
final List<Book> storedBooks = storIOSQLite.get().listOfObjects(Book.class).withQuery(Query.builder().table(BookTableMeta.TABLE).build()).prepare().executeAsBlocking();
assertThat(storedBooks).hasSize(0);
}
use of com.pushtorefresh.storio.sqlite.operations.delete.DeleteResult 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.storio.sqlite.operations.delete.DeleteResult in project storio by pushtorefresh.
the class BaseTest method deleteUserBlocking.
@NonNull
DeleteResult deleteUserBlocking(@NonNull final User user) {
final DeleteResult deleteResult = storIOSQLite.delete().object(user).prepare().executeAsBlocking();
assertThat(deleteResult.numberOfRowsDeleted()).isEqualTo(1);
return deleteResult;
}
Aggregations