public void IsValid() { var item = new IllnessHistoryDto() { Patient = new LightPatientDto(), }; Assert.IsTrue(item.IsValid()); }
public void IsInvalid() { var item = new IllnessHistoryDto() { Patient = null, }; Assert.IsFalse(item.IsValid()); }
/// <summary> /// Gets the illness history for the specified patient. /// </summary> /// <param name="patient">The patient.</param> /// <returns> /// The history of illness periods /// </returns> public IllnessHistoryDto GetIllnessHistory(LightPatientDto patient) { var illnessHistory = new IllnessHistoryDto() { Patient = patient }; var entity = this.Session.Get <Patient>(patient.Id); var periods = Mapper.Map <IList <IllnessPeriod>, IList <IllnessPeriodDto> >(entity.IllnessHistory); illnessHistory.Periods.Refill(periods); return(illnessHistory); }