Bail if loyalty card could not be found

This case was hit at least once by a user, though the scenario
is not known. If it is hit, post a message and bail gracefully,
until the reason can be determined.
This commit is contained in:
Branden Archer
2017-07-23 10:05:05 -04:00
parent 15425d51aa
commit 4143e5c286
9 changed files with 36 additions and 1 deletions

View File

@@ -439,4 +439,24 @@ public class LoyaltyCardViewActivityTest
assertEquals("Block Rotation", menu.findItem(R.id.action_lock_unlock).getTitle().toString());
assertEquals("Edit", menu.findItem(R.id.action_edit).getTitle().toString());
}
@Test
public void startWithMissingLoyaltyCard() throws IOException
{
ActivityController activityController = createActivityWithLoyaltyCard(true);
Activity activity = (Activity)activityController.get();
activityController.start();
activityController.visible();
activityController.resume();
// The activity should find that the card is missing and shut down
assertTrue(activity.isFinishing());
// Make sure the activity can close down
activityController.pause();
activityController.stop();
activityController.destroy();
}
}