public void T7_Update_UpdatesPatientInDB() { Patient testPatient = new Patient("Anderson", "1234 Main Street"); testPatient.Save(); string newName = "Nosredna"; string newAddress = "4321 Side Street"; testPatient.Update(newName, newAddress); string result = testPatient.GetName(); string result2 = testPatient.GetAddress(); Assert.Equal(newName, result); Assert.Equal(newAddress, result2); }
public override bool Equals(System.Object otherPatient) { if (!(otherPatient is Patient)) { return(false); } else { Patient newPatient = (Patient)otherPatient; bool idEquality = this.GetId() == newPatient.GetId(); bool nameEquality = this.GetName() == newPatient.GetName(); bool addressEquality = this.GetAddress() == newPatient.GetAddress(); return(idEquality && nameEquality && addressEquality); } }