Exemple #1
0
        public void Add_appointment_to_patient()
        {
            // Arrange
            Guid        patientId       = Guid.NewGuid();
            DateTime    appointmentDate = DateTime.Now;
            string      interview       = "Patient is quite fit!";
            Appointment appointment     = MakeAppointment(appointmentDate, interview);

            var patient = new PatientEntity();

            _patientDalMock.Stub(x => x.GetPatientById(patientId)).Return(patient).Repeat.Once();
            _patientDalMock.Stub(x => x.SaveOrUpdatePatient(patient)).Repeat.Once();

            // Act
            _patientService.AddAppointmentToPatient(patientId, appointment);

            // Assert
            _patientDalMock.VerifyAllExpectations();
        }
        private void OnAddAppointment()
        {
            var newAppointmentModel = new Appointment {
                Date = DateTime.Now
            };

            if (RaiseAppointmentInteraction(newAppointmentModel, Labels.AddAppointment))
            {
                _patientService.AddAppointmentToPatient(PatientModel.Id, newAppointmentModel);
            }
        }