public void SetUp() { InitMapper(); _token = new CancellationToken(); _repositoryMock = new Mock <IRepository <Flavor> >(); _service = new FlavorService(_repositoryMock.Object, _mapper); }
public IHttpActionResult Delete(int id) { var service = new FlavorService(); service.DeleteFlavor(id); return(Ok()); }
public IHttpActionResult Get(int id) { var service = new FlavorService(); var flavor = service.GetOneFlavor(id); return(Ok(flavor)); }
public IHttpActionResult GetFlavorsByOrderId(int orderID) { FlavorService service = new FlavorService(); var flavor = service.GetAllFlavorsByOrderID(orderID); return(Ok(flavor)); }
public IHttpActionResult GetAll() { FlavorService service = new FlavorService(); var flavor = service.GetAllFlavors(); return(Ok(flavor)); }
public IHttpActionResult Post(FlavorCreate flavor) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var service = new FlavorService(); if (!service.CreateFlavor(flavor)) { return(InternalServerError()); } return(Ok()); }