Search in sources :

Example 6 with PutResult

use of com.pushtorefresh.storio.sqlite.operations.put.PutResult in project storio by pushtorefresh.

the class AutoParcelTest method insertObject.

@Test
public void insertObject() {
    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 List<Book> storedBooks = storIOSQLite.get().listOfObjects(Book.class).withQuery(Query.builder().table(BookTableMeta.TABLE).build()).prepare().executeAsBlocking();
    assertThat(storedBooks).hasSize(1);
    assertThat(storedBooks.get(0)).isEqualTo(book);
}
Also used : PutResult(com.pushtorefresh.storio.sqlite.operations.put.PutResult) Test(org.junit.Test)

Aggregations

PutResult (com.pushtorefresh.storio.sqlite.operations.put.PutResult)6 Test (org.junit.Test)4 NonNull (android.support.annotation.NonNull)1 DeleteResult (com.pushtorefresh.storio.sqlite.operations.delete.DeleteResult)1