public async Task Get_WhenGetByValidId_ReturnOk()
        {
            int id = 1;

            A.CallTo(() => service.GetById(1)).Returns(new AircraftDto());
            IActionResult result = await aircraftsController.Get();

            Assert.True(result is OkObjectResult);
        }
Exemplo n.º 2
0
        public IActionResult Get(int id)
        {
            AircraftDto Aircraft = service.GetById(id);

            if (Aircraft == null)
            {
                return(NotFound());
            }
            return(Ok(Aircraft));
        }
        public async Task <IActionResult> Get(int id)
        {
            AircraftDto Aircraft = await service.GetById(id);

            if (Aircraft == null)
            {
                return(NotFound());
            }
            return(Ok(Aircraft));
        }
Exemplo n.º 4
0
        public async Task <ActionResult> Get(string id)
        {
            var aircraft = await _aircraftService.GetById(id);

            return(Ok(aircraft));
        }