@Test
public void testInsert() {

    // Start with an empty database...
    Cursor cursor = queryAllApks();
    assertNotNull(cursor);
    assertEquals(0, cursor.getCount());
    cursor.close();
    Apk apk = new MockApk("org.fdroid.fdroid", 13);
    // Insert a new record...
    Assert.insertApk(context, apk.packageName, apk.versionCode);
    cursor = queryAllApks();
    assertNotNull(cursor);
    assertEquals(1, cursor.getCount());
    // And now we should be able to recover these values from the apk
    // value object (because the queryAllApks() helper asks for VERSION_CODE and
    // PACKAGE_NAME.
    cursor.moveToFirst();
    Apk toCheck = new Apk(cursor);
    cursor.close();
    assertEquals("org.fdroid.fdroid", toCheck.packageName);
    assertEquals(13, toCheck.versionCode);
}