Ejemplo n.º 1
0
        public void Add_appointment()
        {
            AppointmentDto myAppointment = CreateAppointment();

            HospitalApp.Controllers.AppointmentController controller = new HospitalApp.Controllers.AppointmentController(this.SetupRepository(myAppointment, null).Object);

            var actionResult = controller.Add(myAppointment);

            ConvertToObject(actionResult).ShouldBeEquivalentTo(myAppointment);
        }
Ejemplo n.º 2
0
        public void Get_all_appointments()
        {
            List <AppointmentDto> appointments = CreateAppointments();

            HospitalApp.Controllers.AppointmentController controller = new HospitalApp.Controllers.AppointmentController(this.SetupRepository(null, null).Object);

            var actionResult = controller.GetAll();

            ConvertToList(actionResult).ShouldBeEquivalentTo(appointments);
        }
Ejemplo n.º 3
0
        public void Finish_appointment()
        {
            AppointmentDto myAppointment = CreateAppointments().Find(a => a.Id == 1);

            myAppointment.Status = AppointmentStatus.Done;
            HospitalApp.Controllers.AppointmentController controller = new HospitalApp.Controllers.AppointmentController(this.SetupRepository(myAppointment, null).Object);

            var actionResult = controller.FinishAppointment(myAppointment.Id);

            actionResult.ShouldBeOfType(typeof(OkResult));
        }