public void TestGetSpecificTreatment7() { // Arrange Treatment treatment = controller.GetSpecificTreatment(7); // Assert Assert.AreEqual("7: Skin lnfection on 03-10-2014 00:00:00 costs 35", treatment.ToString()); }
public void TestToString() { Patient patient = new Patient(1, "username", "email", "password", "name", DateTime.Today, "phonenumber", true, Gender.Female, 23); Doctor doctor = new Doctor(1, "username", "email", "password", "name", DateTime.Today, "phonenumber", true, Gender.Female); TreatmentType treatmentType = new TreatmentType("name", "description"); Treatment treatment = new Treatment(1, "name", DateTime.MinValue, DateTime.Today, patient, doctor, treatmentType); Assert.Equal("Webapp.Models.Data.Treatment", treatment.ToString()); }
private void btnRestoreTreatment_Click(object sender, EventArgs e) { try { if (treatmentsBindingSource.Count > 0) { Treatment curel = (Treatment)treatmentsBindingSource.Current; if (curel == null || curel.deletedDate == null) { Display.ShowWarning(string.Format(Properties.Resources.MustSelectToRestore, "a treatment")); return; } if (Display.ShowMessageWithConferm(string.Format(Properties.Resources.SureToRestore, "the treatment", curel.ToString()), Properties.Resources.WorningDataRestoring) == System.Windows.Forms.DialogResult.Yes) { if (oViewEditing.actualStatus != state.insert) { oViewEditing.actualStatus = state.edit; } curel.deletedDate = null; curel.CurrentState = ObjectState.edit; } else { Display.ShowMessage(string.Format(Properties.Resources.WarningNotRestored, "Treatment")); } } else { Display.ShowWarning(string.Format(Properties.Resources.TheresNo, "treatment")); } } catch (Exception ex) { Display.ShowError(ex.Message); } }