private void checkLoyaltyCards(){
  Cursor cursor=db.getLoyaltyCardCursor();
  int index=1;
  while (cursor.moveToNext()) {
    LoyaltyCard card=LoyaltyCard.toLoyaltyCard(cursor);
    String expectedStore=String.format("store, \"%4d",index);
    String expectedNote=String.format("note, \"%4d",index);
    assertEquals(expectedStore,card.store);
    assertEquals(expectedNote,card.note);
    assertEquals(BARCODE_DATA,card.cardId);
    assertEquals(BARCODE_TYPE,card.barcodeType);
    index++;
  }
  cursor.close();
}

private void checkLoyaltyCards ( ) { Cursor cursor = db . getLoyaltyCardCursor ( ) ; int index = 1 ; while ( cursor . moveToNext ( ) ) { LoyaltyCard card = LoyaltyCard . toLoyaltyCard ( cursor ) ; String expectedStore = String . format ( "store, \"%4d" , index ) ; String expectedNote = String . format ( "note, \"%4d" , index ) ; assertEquals ( expectedStore , card . store ) ; assertEquals ( expectedNote , card . note ) ; assertEquals ( BARCODE_DATA , card . cardId ) ; assertEquals ( BARCODE_TYPE , card . barcodeType ) ; index ++ ; } cursor . close ( ) ; }
check that all of the cards follow the pattern specified in addloyaltycards ( ) , and are in sequential order where the smallest card ' s index is 1
