コード例 #1
0
  public void testInsert() throws Exception {
    DbHelperProviderClient.addCall("AAAA", new Date(), 23.0f, 23, mContext);
    DbHelperProviderClient.addCall("BBBB", new Date(), 23.0f, 23, mContext);

    Cursor c = DbHelperProviderClient.getAllCall(mContext);
    assertEquals(c.getCount(), 2);
  }
コード例 #2
0
 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");
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 @Override
 public void setUp() throws Exception {
   mContext = getContext();
   DbHelperProviderClient.removeAllCall(mContext);
   DbHelperProviderClient.removeAllEvent(mContext);
 }