Ejemplo n.º 1
0
        public async void BookPatient_Should_Call_IBittnService_BookPatient()
        {
            var request = new BookPatientApiRequest
            {
                ConditionId   = 123,
                ConditionName = "conditionName",
                HelpId        = 456,
                HelpName      = "helpName",
                PatientName   = "patientName",
                Severity      = 789
            };

            var service            = Substitute.For <IBittnService>();
            BookPatientRequest arg = null;

            service.BookPatient(Arg.Do <BookPatientRequest>(a => arg = a)).Returns(new BookPatientResponse());

            await _controller.BookPatient(request, service);

            await service.Received(1).BookPatient(Arg.Any <BookPatientRequest>());

            arg.ConditionId.Should().Be(request.ConditionId);
            arg.ConditionName.Should().Be(request.ConditionName);
            arg.HelpId.Should().Be(request.HelpId);
            arg.HelpName.Should().Be(request.HelpName);
            arg.PatientName.Should().Be(request.PatientName);
            arg.SeverityLevel.Should().Be(request.Severity);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <ApiResponse> > BookPatient([FromBody] BookPatientApiRequest request, [FromServices] IBittnService bittnService)
        {
            var response = await bittnService.BookPatient(new BookPatientRequest
            {
                ConditionId   = request.ConditionId,
                ConditionName = request.ConditionName,
                HelpId        = request.HelpId,
                HelpName      = request.HelpName,
                PatientName   = request.PatientName,
                SeverityLevel = request.Severity
            });

            return(ApiResponseHelper.Ok($"Booking created.", response));
        }
Ejemplo n.º 3
0
 public BookPatientApiRequestTests()
 {
     _request = new BookPatientApiRequest();
 }