Esempio n. 1
0
        public async void BookPatient_Should_Call_IBittnRepository_AddBooking()
        {
            BookingDetails arg = null;

            _bittnRepository
            .AddBooking(Arg.Do <BookingDetails>(a => arg = a))
            .Returns(new BookingDetails());

            var request = new BookPatientRequest
            {
                ConditionId   = 123,
                ConditionName = "conditionName",
                HelpId        = 456,
                HelpName      = "helpName",
                PatientName   = "patientName",
                SeverityLevel = 789
            };

            await _service.BookPatient(request);

            await _bittnRepository.Received(1).AddBooking(Arg.Any <BookingDetails>());

            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.SeverityLevel);
            arg.CreateDate.ToString("yyyy-MM-dd").Should().Be(DateTimeOffset.UtcNow.ToString("yyyy-MM-dd"));
        }
Esempio n. 2
0
        public async Task <BookPatientResponse> BookPatient(BookPatientRequest request)
        {
            var added = await _bittnRepository.AddBooking(new BookingDetails
            {
                ConditionId   = request.ConditionId,
                ConditionName = request.ConditionName,
                HelpId        = request.HelpId,
                HelpName      = request.HelpName,
                PatientName   = request.PatientName,
                SeverityLevel = request.SeverityLevel,
                CreateDate    = DateTimeOffset.UtcNow
            });

            return(new BookPatientResponse
            {
                Id = added.Id
            });
        }