public void RegisteringTwoNewPatientWithTheSameName() { var hospital = new Hospital(); var vm = new PatientViewModel(hospital); var closeActionMock = new Mock <Action>(); vm.CloseAction = closeActionMock.Object; vm.PatientName = "TestPatient"; vm.SaveNewPatient(null); Assert.AreEqual(hospital.Consultations.Count, 1); vm.PatientName = "TestPatient"; vm.SaveNewPatient(null); Assert.AreEqual(vm.ErrorMessage, "A patient with the specifed name already exist."); }
public void RegisteringNewPatientShouldAlsoScheduleInitialConsultation() { var hospital = new Hospital(); var vm = new PatientViewModel(hospital); var closeActionMock = new Mock <Action>(); vm.CloseAction = closeActionMock.Object; vm.PatientName = "TestPatient"; vm.SaveNewPatient(null); Assert.AreEqual(hospital.Consultations.Count, 1); }