public void TestGetPatient() { PatientsDBAccess.ICUStatu obj = new ICUStatu(); List <ICUStatu> patients1 = new List <ICUStatu>(); List <ICUStatu> patients2 = new List <ICUStatu>(); obj.FirstName = "Pranay"; obj.LastName = "Kumar"; obj.PatientDob = "07/11/1996"; obj.PatientGender = "Male"; obj.PatientHeight = 179; obj.DoctorAssigned = "Navaneeth"; obj.bedNo = 5; obj.PatientWeight = 63; obj.ReasonAdmitted = "yo"; obj.OtherMedications = "yo"; obj.PatientId = "1"; obj.AdmissionDate = "yo"; patients1.Add(obj); IcuDbMySqlRepo obj2 = new IcuDbMySqlRepo(); patients2 = obj2.GetPatient(); Assert.AreEqual(patients1[0].FirstName, patients2[0].FirstName); Assert.AreEqual(patients1[0].PatientGender, patients2[0].PatientGender); Assert.AreEqual(patients1[0].PatientHeight, patients2[0].PatientHeight); Assert.AreEqual(patients1[0].LastName, patients2[0].LastName); Assert.AreEqual(patients1[0].PatientDob, patients2[0].PatientDob); Assert.AreEqual(patients1[0].PatientId, patients2[0].PatientId); Assert.AreEqual(patients1[0].ReasonAdmitted, patients2[0].ReasonAdmitted); Assert.AreEqual(patients1[0].PatientWeight, patients2[0].PatientWeight); }
public void TestAddPatient() { PatientsDBAccess.ICUStatu obj = new ICUStatu(); List <ICUStatu> patients1 = new List <ICUStatu>(); List <ICUStatu> patients2 = new List <ICUStatu>(); Random r = new Random(); obj.FirstName = RandomString(5, true); obj.LastName = RandomString(5, true);; obj.PatientDob = "07/11/96"; obj.PatientGender = "Male"; obj.PatientHeight = r.Next(); obj.DoctorAssigned = RandomString(5, true);; obj.bedNo = 5; obj.PatientWeight = 63; obj.ReasonAdmitted = "yo"; obj.OtherMedications = "yo"; obj.PatientId = RandomString(5, true);; obj.AdmissionDate = "yo"; IcuDbMySqlRepo obj2 = new IcuDbMySqlRepo(); patients2 = obj2.GetPatient(); int initialcount = patients2.Count; obj2.AddPatient(obj); patients2 = obj2.GetPatient(); int finalcount = patients2.Count; Assert.AreEqual(initialcount + 1, finalcount); }
public void TestDischarge() { IcuDbMySqlRepo obj = new IcuDbMySqlRepo(); obj.DischargePatient("TRJIW433", 2); int spo2 = 0, pulse = 0; double temp = 0.0; string id = "TRJIW433"; Assert.Throws <InvalidOperationException>( delegate { obj.ReadRecord(ref id, ref spo2, ref pulse, ref temp); }); }
public void TestRead() { IcuDbMySqlRepo obj1 = new IcuDbMySqlRepo(); string id = "TRJIW431"; int spo2 = 0, pulse = 0; double temp = 0.0; obj1.ReadRecord(ref id, ref spo2, ref pulse, ref temp); Assert.AreEqual(96, spo2); Assert.AreEqual(75, temp); Assert.AreEqual(98, pulse); }
public void AdmitPatient() { IcuDbMySqlRepo obj = new IcuDbMySqlRepo(); string id = "TRJIW432"; int spo2 = 0, pulse = 0; double temp = 0.0; obj.AdmitPatient(id, 9); obj.ReadRecord(ref id, ref spo2, ref pulse, ref temp); Assert.AreEqual(97, spo2); Assert.AreEqual(76.0, temp); Assert.AreEqual(99, pulse); }