public IHttpActionResult PostTravel([FromBody] Travel travel) { //var userId = ide.GetUserId(); TravelService.ImageParser = new GoogleImageParser.GoogleImageParser(HttpContext.Current.Server.MapPath("~")); TravelService.Create(travel, User.Identity); return(Ok(travel)); }
public void InsertTravel() { try { var inserted = _travelService.Create(new Service.Model.Travel { Name = "Test" }); var travel = _travelService.Get(inserted.Id); Assert.Equals(inserted.Id, travel.Id); Assert.Equals(inserted.Name, travel.Name); _travelService.Delete(inserted.Id); Assert.Pass("InsertTravel"); } catch (Exception e) { Assert.Fail("InsertTravel"); } }