public IActionResult GetCoffee([FromRoute] int id) { var coffee = _coffeeManager.GetCoffee(id); if (coffee == null) { return(NotFound("There is no object with such ID in a DataBase. Try another one.")); } var response = _mapper.Map <CoffeeResponse>(coffee); return(Ok(response)); }
public void GetCoffee_WhenCalled_ReturnsCoffee(int id) { var result = _manager.GetCoffee(id); Assert.That(result, Is.TypeOf <Coffee>()); }