@Test
public void testInsert() {

    // Start with an empty database...
    Cursor cursor = queryAllApps();
    assertNotNull(cursor);
    assertEquals(0, cursor.getCount());
    cursor.close();
    // Insert a new record...
    insertApp("org.fdroid.fdroid", "F-Droid");
    cursor = queryAllApps();
    assertNotNull(cursor);
    assertEquals(1, cursor.getCount());
    // And now we should be able to recover these values from the app
    // value object (because the queryAllApps() helper asks for NAME and
    // PACKAGE_NAME.
    cursor.moveToFirst();
    App app = new App(cursor);
    cursor.close();
    assertEquals("org.fdroid.fdroid", app.packageName);
    assertEquals("F-Droid", app.name);
    App otherApp = AppProvider.Helper.findSpecificApp(context.getContentResolver(), "org.fdroid.fdroid", 1, Cols.ALL);
    assertNotNull(otherApp);
    assertEquals("org.fdroid.fdroid", otherApp.packageName);
    assertEquals("F-Droid", otherApp.name);
}