public void testGetPatient() throws iTrustException {
    PatientBean pBean = action.getPatient();
    assertEquals(2L, pBean.getMID());

    pBean = action.getPatient(2L);
    assertEquals(2L, pBean.getMID());
  }
  public void testIsSurveyCompleted() throws iTrustException {
    List<OfficeVisitBean> ovbList = action.getAllOfficeVisits();

    OfficeVisitBean ovBean = ovbList.get(0);

    assertFalse(action.isSurveyCompleted(ovBean.getID()));
  }
  public void testRepresentPatient() throws iTrustException {
    String StrRep = new String("3");
    long longRep = (new Long(StrRep)).longValue();
    long mid = action.representPatient("3");

    assertEquals(longRep, mid);
  }
  public void testViewNonExistantRecords() {
    action = new ViewMyRecordsAction(evil, 0l);
    try {
      action.getFamilyHistory();
    } catch (iTrustException e) {
      assertEquals(
          "A database exception has occurred. Please see the log in the console for stacktrace",
          e.getMessage());
    }

    try {
      action.getFamily();
    } catch (iTrustException e) {
      assertEquals(
          "A database exception has occurred. Please see the log in the console for stacktrace",
          e.getMessage());
    }
  }
 public void testViewMyRecords() throws Exception {
   assertEquals(pid, action.getPatient().getMID());
   assertEquals(2, action.getAllergies().size());
   assertEquals(9, action.getFamily().size());
   assertEquals(2, action.getAllHealthRecords().size());
   assertEquals(9, action.getAllOfficeVisits().size());
   assertEquals(6, action.getRepresented().size());
   assertEquals(0, action.getRepresenting().size());
   assertTrue(action.isSurveyCompleted(952));
   assertEquals(1, action.getLabs().size());
   action.representPatient("1");
   assertEquals(1L, action.getPatient().getMID());
   assertTrue(action.doesFamilyMemberHaveHighBP(fmBean));
   assertTrue(action.doesFamilyMemberHaveDiabetes(fmBean));
   assertTrue(action.isFamilyMemberSmoker(fmBean));
   assertFalse(action.doesFamilyMemberHaveCancer(fmBean));
   assertFalse(action.doesFamilyMemberHaveHighCholesterol(fmBean));
   assertFalse(action.doesFamilyMemberHaveHeartDisease(fmBean));
   assertTrue(action.getFamilyMemberCOD(fmBean).contains("Diabetes"));
   assertEquals(5, new ViewMyRecordsAction(factory, 5L).getFamilyHistory().size());
 }
 public void testGetFamilyMemberCOD() throws iTrustException {
   assertEquals("Diabetes with ketoacidosis", action.getFamilyMemberCOD(fmBean));
 }
 public void testIsFamilyMemberSmoker() throws iTrustException {
   assertTrue(action.isFamilyMemberSmoker(fmBean));
 }
 public void testDoesFamilyMemberHaveHeartDisease() throws iTrustException {
   assertFalse(action.doesFamilyMemberHaveHeartDisease(fmBean));
 }
 public void testDoesFamilyMemberHaveCancer() throws iTrustException {
   assertFalse(action.doesFamilyMemberHaveCancer(fmBean));
 }
  public void testGetAllergies() throws iTrustException {
    List<AllergyBean> abList = action.getAllergies();

    assertEquals(2, abList.size());
  }
  public void testGetReportRequests() throws iTrustException {
    List<ReportRequestBean> rrbList = action.getReportRequests();

    assertEquals(4, rrbList.size());
  }
  public void testGetLabs() throws iTrustException {
    List<LabProcedureBean> lpbList = action.getLabs();

    assertEquals(1, lpbList.size());
  }
  public void testGetRepresenting() throws iTrustException {
    List<PatientBean> pbList = action.getRepresenting();

    assertEquals(0, pbList.size());
  }
  public void testGetAllOfficeVisits() throws iTrustException {
    List<OfficeVisitBean> ovbList = action.getAllOfficeVisits();

    assertEquals(9, ovbList.size());
  }
  public void testGetFamilyHealthRecords() throws iTrustException {
    List<HealthRecord> hrList = action.getFamilyHealthRecords(this.pid);

    assertEquals(2, hrList.size());
  }
  public void testGetFamilyHistory() throws iTrustException {
    List<FamilyMemberBean> fmbList = action.getFamilyHistory();

    assertEquals(5, fmbList.size());
  }
 public void testDoesFamilyMemberHaveHighCholesterol() throws iTrustException {
   assertFalse(action.doesFamilyMemberHaveHighCholesterol(fmBean));
 }
 public void testDoesFamilyMemberHaveDiabetes() throws iTrustException {
   assertTrue(action.doesFamilyMemberHaveDiabetes(fmBean));
 }
  public void testGetPersonnel() throws iTrustException {
    PersonnelBean pBean = action.getPersonnel(hcpId);

    assertEquals(hcpId, pBean.getMID());
  }
  public void testGetEmailHistory() throws iTrustException {
    List<Email> eList = action.getEmailHistory();

    assertEquals(2, eList.size());
  }