public void T4_Save_SavesToDB() { CriticalPatient result = new CriticalPatient("Anderson", "1234 Main Street", 2); result.CriticalSave(); Console.WriteLine(result.GetId()); Console.WriteLine(result.GetCriticalPatientId()); Assert.Equal(result.GetId(), Patient.GetAll()[0].GetId()); }
public override bool Equals(System.Object otherPatient) { if (!(otherPatient is CriticalPatient)) { return(false); } else { CriticalPatient newPatient = (CriticalPatient)otherPatient; bool idEquality = this.GetId() == newPatient.GetId(); bool nameEquality = this.GetName() == newPatient.GetName(); bool addressEquality = this.GetAddress() == newPatient.GetAddress(); bool frequencyEquality = this.GetFrequency() == newPatient.GetFrequency(); return(idEquality && nameEquality && addressEquality && frequencyEquality); } }