예제 #1
0
 public void testOverallProsCons() {
   assertNotNull(overallProsConsTable);
   assertEquals("care about patient", overallPros1.getText());
   assertEquals("quick diagnosis", overallPros2.getText());
   assertEquals("easy for parking", overallPros3.getText());
   assertEquals("don't care about patient", overallCons1.getText());
   assertEquals("slow diagnosis", overallCons2.getText());
   assertEquals("hard for parking", overallCons3.getText());
 }
예제 #2
0
  public void testRatings() {
    titleView = expandableListView.getChildAt(0);
    stars = (RatingBar) titleView.findViewById(R.id.providerpf_comment_stars);
    date = (TextView) titleView.findViewById(R.id.providerpf_comment_date);
    userName = (TextView) titleView.findViewById(R.id.providerpf_user_name);
    assertEquals("By username1", userName.getText());
    assertEquals("2012-12-12 ", date.getText());
    assertEquals(5.0, stars.getRating(), 0.0);

    titleView = expandableListView.getChildAt(1);
    stars = (RatingBar) titleView.findViewById(R.id.providerpf_comment_stars);
    date = (TextView) titleView.findViewById(R.id.providerpf_comment_date);
    userName = (TextView) titleView.findViewById(R.id.providerpf_user_name);
    assertEquals("By username2", userName.getText());
    assertEquals("2012-11-12 ", date.getText());
    assertEquals(3.0, stars.getRating(), 0.0);

    titleView = expandableListView.getChildAt(2);
    stars = (RatingBar) titleView.findViewById(R.id.providerpf_comment_stars);
    date = (TextView) titleView.findViewById(R.id.providerpf_comment_date);
    userName = (TextView) titleView.findViewById(R.id.providerpf_user_name);
    assertEquals("By username3", userName.getText());
    assertEquals("2012-10-12 ", date.getText());
    assertEquals(3.0, stars.getRating(), 0.0);

    titleView = expandableListView.getChildAt(3);
    stars = (RatingBar) titleView.findViewById(R.id.providerpf_comment_stars);
    date = (TextView) titleView.findViewById(R.id.providerpf_comment_date);
    userName = (TextView) titleView.findViewById(R.id.providerpf_user_name);
    assertEquals("By username4", userName.getText());
    assertEquals("2012-09-12 ", date.getText());
    assertEquals(4.0, stars.getRating(), 0.0);

    listAdapter = expandableListView.getExpandableListAdapter();
    listView = listAdapter.getChildView(0, 0, true, null, null);
    tv_provider_summary = (TextView) listView.findViewById(R.id.providerpf_rate_review_summary);
    assertEquals(tv_provider_summary.getText(), "Very Good");
    tv_pro1 = (TextView) listView.findViewById(R.id.providerpf_review_pro1);
    assertEquals(tv_pro1.getText(), "care about patient");
    tv_pro2 = (TextView) listView.findViewById(R.id.providerpf_review_pro2);
    assertEquals(tv_pro2.getText(), "quick diagnosis");
    tv_pro3 = (TextView) listView.findViewById(R.id.providerpf_review_pro3);
    assertEquals(tv_pro3.getText(), "easy for parking");
    tv_con1 = (TextView) listView.findViewById(R.id.providerpf_review_con1);
    assertEquals(tv_con1.getText(), "don't care about patient");
    tv_con2 = (TextView) listView.findViewById(R.id.providerpf_review_con2);
    assertEquals(tv_con2.getText(), "slow diagnosis");
    tv_con3 = (TextView) listView.findViewById(R.id.providerpf_review_con3);
    assertEquals(tv_con3.getText(), "hard for parking");
    tv_provider_desc = (TextView) listView.findViewById(R.id.providerpf_comment_review);
    assertEquals(tv_provider_desc.getText(), "A good doctor!");
    listView = listAdapter.getChildView(1, 0, true, null, null);
    tv_provider_summary = (TextView) listView.findViewById(R.id.providerpf_rate_review_summary);
    assertEquals(tv_provider_summary.getText(), "");
    tv_pro1 = (TextView) listView.findViewById(R.id.providerpf_review_pro1);
    assertEquals(tv_pro1.getText(), "care about patient");
    tv_pro2 = (TextView) listView.findViewById(R.id.providerpf_review_pro2);
    assertEquals(tv_pro2.getText(), "quick diagnosis");
    tv_pro3 = (TextView) listView.findViewById(R.id.providerpf_review_pro3);
    assertEquals(tv_pro3.getText(), "");
    tv_con1 = (TextView) listView.findViewById(R.id.providerpf_review_con1);
    assertEquals(tv_con1.getText(), "don't care about patient");
    tv_con2 = (TextView) listView.findViewById(R.id.providerpf_review_con2);
    assertEquals(tv_con2.getText(), "");
    tv_con3 = (TextView) listView.findViewById(R.id.providerpf_review_con3);
    assertEquals(tv_con3.getText(), "");
    tv_provider_desc = (TextView) listView.findViewById(R.id.providerpf_comment_review);
    assertEquals(tv_provider_desc.getText(), "");
    listView = listAdapter.getChildView(2, 0, true, null, null);
    tv_provider_summary = (TextView) listView.findViewById(R.id.providerpf_rate_review_summary);
    assertEquals(tv_provider_summary.getText(), "Fair");
    tv_pro1 = (TextView) listView.findViewById(R.id.providerpf_review_pro1);
    assertEquals(tv_pro1.getText(), "adequate parking");
    tv_pro2 = (TextView) listView.findViewById(R.id.providerpf_review_pro2);
    assertEquals(tv_pro2.getText(), "availability of appointments");
    tv_pro3 = (TextView) listView.findViewById(R.id.providerpf_review_pro3);
    assertEquals(tv_pro3.getText(), "cleanliness/attractiveness of office");
    tv_con1 = (TextView) listView.findViewById(R.id.providerpf_review_con1);
    assertEquals(tv_con1.getText(), "");
    tv_con2 = (TextView) listView.findViewById(R.id.providerpf_review_con2);
    assertEquals(tv_con2.getText(), "");
    tv_con3 = (TextView) listView.findViewById(R.id.providerpf_review_con3);
    assertEquals(tv_con3.getText(), "");
    tv_provider_desc = (TextView) listView.findViewById(R.id.providerpf_comment_review);
    assertEquals(tv_provider_desc.getText(), "Hard to say - just so so");
    listView = listAdapter.getChildView(3, 0, true, null, null);
    tv_provider_summary = (TextView) listView.findViewById(R.id.providerpf_rate_review_summary);
    assertEquals(tv_provider_summary.getText(), "Good");
    tv_pro1 = (TextView) listView.findViewById(R.id.providerpf_review_pro1);
    assertEquals(tv_pro1.getText(), "");
    tv_pro2 = (TextView) listView.findViewById(R.id.providerpf_review_pro2);
    assertEquals(tv_pro2.getText(), "");
    tv_pro3 = (TextView) listView.findViewById(R.id.providerpf_review_pro3);
    assertEquals(tv_pro3.getText(), "");
    tv_con1 = (TextView) listView.findViewById(R.id.providerpf_review_con1);
    assertEquals(tv_con1.getText(), "");
    tv_con2 = (TextView) listView.findViewById(R.id.providerpf_review_con2);
    assertEquals(tv_con2.getText(), "");
    tv_con3 = (TextView) listView.findViewById(R.id.providerpf_review_con3);
    assertEquals(tv_con3.getText(), "");
    tv_provider_desc = (TextView) listView.findViewById(R.id.providerpf_comment_review);
    assertEquals(tv_provider_desc.getText(), "He is so handsome:)");
  }
예제 #3
0
 public void testRating() {
   assertEquals("3.0", rating.getText());
 }
예제 #4
0
 public void testPhone() {
   assertEquals("(215)662-3228", phone.getText());
 }
예제 #5
0
 public void testAddress() {
   assertEquals("3400 Spruce Street, Philadelphia, PA  19104", address.getText());
 }
예제 #6
0
 public void testName() {
   assertEquals("testProvider", name.getText());
 }