public void Functional_GetPatientbyID() { try { Demographics d = new Demographics(); Patient p = new Patient(d); p.FirstName = "alex"; p.LastName = "koxak"; p.HCN = "0987654321GF"; p.MInitial = "A"; p.DateOfBirth = "12111997"; p.Sex = "M"; p.HeadOfHouse = "1234567890AB"; d.AddNewPatient(p); int count = d.GetPatientIDByHCN(p.HCN); Patient dp = d.GetPatientByID(count); if (dp != null) { if (!(dp.HCN == p.HCN)) { Assert.Fail(); } } } catch (Exception) { Assert.Fail(); } }
public void Null_GetPatientIDByHCN() { try { Demographics d = new Demographics(); int pID = d.GetPatientIDByHCN(null); if (!(pID == -1)) { Assert.Fail(); } } catch (Exception) { Assert.Fail(); } }
public void Functional_GetPatientIDByHCN() { try { Demographics d = new Demographics(); int pID = d.GetPatientIDByHCN("1234567890AB"); Patient p = d.GetPatientByHCN("1234567890AB"); if (!(pID == p.PatientID)) { Assert.Fail(); } } catch (Exception) { Assert.Fail(); } }