public void GetHospitalById(int Id) { using (IDal dal = new Dal()) { List<Hospital> hospitals = dal.ReadHospitals(); Hospital hospital_1 = hospitals[0]; int IdEntity = hospital_1.Id; Hospital hospital_2 = dal.SelectHospitalById(Id); Assert.IsNotNull(hospital_2); Assert.AreEqual(IdEntity, hospital_2.Id); } }
public void UpdateHospital() { using (IDal dal = new Dal()) { List<Hospital> hospitals = dal.ReadHospitals(); Hospital hospital = hospitals[0]; // entite à modifier hospital.Name = "Hassan 2"; hospital.Town = "Rabat"; dal.UpdateHospital(hospital); Hospital hopital_2 = dal.SelectHospitalById(hospital.Id); Assert.IsNotNull(hopital_2); Assert.AreEqual(hopital_2.Name, "Hassan 2"); Assert.AreEqual(hopital_2.Town, "Rabat"); } }