mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-05-18 05:36:39 -04:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user