public void T5_Find_FindsConditionEvalInDB() { DateTime statusDate = new DateTime(2016, 08, 04); ConditionEval testConditionEval = new ConditionEval(1, 2, 1, statusDate); testConditionEval.Save(); ConditionEval foundConditionEval = ConditionEval.Find(testConditionEval.GetId()); Assert.Equal(testConditionEval, foundConditionEval); }
public void T4_Save_AssignsIdToConditionEval() { DateTime statusDate = new DateTime(2016, 08, 04); ConditionEval testConditionEval = new ConditionEval(1, 2, 1, statusDate); testConditionEval.Save(); ConditionEval savedConditionEval = ConditionEval.GetAll()[0]; int result = savedConditionEval.GetId(); int testId = testConditionEval.GetId(); Assert.Equal(testId, result); }
public override bool Equals(System.Object otherConditionEval) { if (!(otherConditionEval is ConditionEval)) { return(false); } else { ConditionEval newConditionEval = (ConditionEval)otherConditionEval; bool idEquality = this.GetId() == newConditionEval.GetId(); bool patientIdEquality = this.GetPatientId() == newConditionEval.GetPatientId(); bool conditionIdEquality = this.GetConditionId() == newConditionEval.GetConditionId(); bool doctorIdEquality = this.GetDoctorId() == newConditionEval.GetDoctorId(); bool statusDateEquality = this.GetConditionEvalDate() == newConditionEval.GetConditionEvalDate(); return(idEquality && patientIdEquality && conditionIdEquality && statusDateEquality && doctorIdEquality); } }