display store and note on card summary view

Dutch translation provided by PanderMusubi

Related issues:
https://github.com/brarcher/loyalty-card-locker/issues/23
https://github.com/brarcher/loyalty-card-locker/issues/24
This commit is contained in:
Branden Archer
2016-04-09 22:11:20 -04:00
parent f6f749de1c
commit e0a77e9628
6 changed files with 35 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ public class LoyaltyCardCursorAdapterTest
@Test
public void TestCursorAdapter()
public void TestCursorAdapterEmptyNote()
{
db.insertLoyaltyCard("store", "", "cardId", BarcodeFormat.UPC_A.toString());
LoyaltyCard card = db.getLoyaltyCard(1);
@@ -67,4 +67,25 @@ public class LoyaltyCardCursorAdapterTest
checkView(view, card.store, cardIdText);
}
@Test
public void TestCursorAdapterWithNote()
{
db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString());
LoyaltyCard card = db.getLoyaltyCard(1);
Cursor cursor = db.getLoyaltyCardCursor();
cursor.moveToFirst();
View view = createView(cursor);
final String storeNameAndNoteFormat = activity.getResources().getString(R.string.storeNameAndNoteFormat);
String storeAndNoteText = String.format(storeNameAndNoteFormat, card.store, card.note);
final String cardIdLabel = activity.getResources().getString(R.string.cardId);
final String cardIdFormat = activity.getResources().getString(R.string.cardIdFormat);
String cardIdText = String.format(cardIdFormat, cardIdLabel, card.cardId);
checkView(view, storeAndNoteText, cardIdText);
}
}