Code example for Cursor

Methods: getCountisClosedmoveToFirst

0
        assertThat(stringValueFromDatabase).isEqualTo(name);
    } 
 
    protected void assertEmptyDatabase() { 
        Cursor cursor = database.query("table_name", new String[]{"id", "name"}, null, null, null, null, null);
        assertThat(cursor.moveToFirst()).isFalse();
        assertThat(cursor.isClosed()).isFalse();
        assertThat(cursor.getCount()).isEqualTo(0);
    } 
 
    protected void assertNonEmptyDatabase() { 
        Cursor cursor = database.query("table_name", new String[]{"id", "name"}, null, null, null, null, null);
        assertThat(cursor.moveToFirst()).isTrue();
        assertThat(cursor.getCount()).isNotEqualTo(0);
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE