Skip to content

Commit

Permalink
Merge pull request #5 from brarcher/unit-tests
Browse files Browse the repository at this point in the history
Unit tests
  • Loading branch information
brarcher committed Jan 27, 2016
2 parents ac2b0a1 + a3d9f5f commit bccb868
Show file tree
Hide file tree
Showing 5 changed files with 525 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "protect.gift_card_guard"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
versionCode 2
versionName "0.1.1"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class GiftCardViewActivity extends AppCompatActivity
{
private static final String TAG = "GiftCardGuard";
private static final int REQUEST_IMAGE_CAPTURE = 1;
private static final String RECEIPT_IMAGE_DIR = "receipts";

private String capturedUncommittedReceipt = null;

Expand Down
10 changes: 10 additions & 0 deletions app/src/test/java/protect/gift_card_guard/DatabaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ public void updateGiftCard()
assertEquals("receipt1", giftCard.receipt);
}

@Test
public void updateMissingGiftCard()
{
assertEquals(0, db.getGiftCardCount());

boolean result = db.updateGiftCard(1, "store1", "cardId1", "value1", "receipt1");
assertEquals(false, result);
assertEquals(0, db.getGiftCardCount());
}

@Test
public void emptyGiftCardValues()
{
Expand Down
Loading

0 comments on commit bccb868

Please sign in to comment.