예제 #1
0
        public async void GetAirplane_IdDoesNotExist_ShouldFail()
        {
            SetUpMocksAndServices();
            var result = await _aircraftService.FindById(notValidId);

            Assert.False(result.Success);
        }
예제 #2
0
        public async Task <IActionResult> Get(int id)
        {
            var result = await _aircraftService.FindById(id);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            var aircraftDTO = _mapper.Map <T, TResponse>(result.Aircraft);

            return(Ok(aircraftDTO));
        }