public async Task <ActionResult <PatientDto> > GetByIdAsync(int id)
        {
            var query    = new GetPatientById.Query(id);
            var response = await _mediator.Send(query);

            return(Ok(response.PatientDto));
        }
Esempio n. 2
0
        public async Task GetPatientById()
        {
            // Arrange
            var query = new GetPatientById.Query(99);
            var sut   = new GetPatientById.Handler(_patientService);

            // Act
            var response = await sut.Handle(query, new CancellationToken());

            // Assert
            response.PatientDto.Id.Should().Be(99);
        }