/**
   * Test that baseball card data for multiple cards is correctly added to the database when it is
   * entered into the {@link BaseballCardDetails} activity. This test enters all data using a single
   * invocation of the {@link BaseballCardDetails} activity.
   *
   * @throws Throwable If an error occurs while the portion of the test on the UI thread runs.
   */
  public void testAddMultipleCards() throws Throwable {
    for (BaseballCard nextCard : this.allCards) {
      BBCTTestUtil.addCard(this.solo, nextCard);
      BBCTTestUtil.waitForToast(this.solo, BBCTTestUtil.ADD_MESSAGE);
    }

    DatabaseUtil dbUtil = new DatabaseUtil(this.inst.getTargetContext());
    for (BaseballCard nextCard : this.allCards) {
      Assert.assertTrue("Missing card: " + nextCard, dbUtil.containsBaseballCard(nextCard));
    }
  }
 /**
  * Test that baseball card data is correctly added to the database when it is entered into the
  * {@link BaseballCardDetails} activity.
  *
  * @throws Throwable If an error occurs while the portion of the test on the UI thread runs.
  */
 public void testAddCard() throws Throwable {
   BBCTTestUtil.addCard(this.solo, this.card);
   BBCTTestUtil.waitForToast(this.solo, BBCTTestUtil.ADD_MESSAGE);
   DatabaseUtil dbUtil = new DatabaseUtil(this.inst.getTargetContext());
   Assert.assertTrue("Missing card: " + this.card, dbUtil.containsBaseballCard(this.card));
 }
 private void testAutoComplete(AutoCompleteTextView textView, String text) throws Throwable {
   BBCTTestUtil.addCard(this.solo, this.card);
   this.solo.typeText(textView, text.substring(0, 2));
   this.solo.waitForText(text);
   Assert.assertTrue(textView.isPopupShowing());
 }