public void testEdit() { DbHelperProviderClient.addEvent("BBBB", new Date(), "ShortEvent", mContext); Cursor c = DbHelperProviderClient.getAllEvent(mContext); c.moveToFirst(); int index = c.getInt(0); DbHelperProviderClient.updateEvent(index, "CCCC", new Date(), "ShortName1", mContext); c = DbHelperProviderClient.getAllEvent(mContext); c.moveToFirst(); assertEquals(c.getString(DbHelperDbHelper.EVENT_DESCRIPTION_COLUMN_POSITION), "CCCC"); }
public void testDelete() { DbHelperProviderClient.addEvent("AAAA", new Date(), "ShortEvent", mContext); DbHelperProviderClient.addEvent("BBBB", new Date(), "ShortEvent", mContext); Cursor c = DbHelperProviderClient.getAllEvent(mContext); c.moveToFirst(); int index = c.getInt(0); DbHelperProviderClient.removeEvent(index, mContext); Cursor c1 = DbHelperProviderClient.getAllEvent(mContext); assertEquals(c1.getCount(), 1); }