public IHttpActionResult GetTrip(int id) { TripService tripService = CreateTripService(); var trip = tripService.GetTripById(id); return(Ok(trip)); }
public Trip GetTripById(string id) { Guid guid = new Guid(); Guid.TryParse(id, out guid); return(TripService.GetTripById(guid)); }
public IHttpActionResult Get(int id) { var tripService = new TripService(Guid.Parse(User.Identity.GetUserId())); var note = tripService.GetTripById(id); if (note == null) { return(NotFound()); } return(Ok(note)); }
public void Test_GetTripById_Success() { // Arrange var tripId = "123"; // Act _tripService.GetTripById(tripId); // Assert _mockTripRepository.Verify(m => m.GetTripById(tripId), Times.Once()); }
public IHttpActionResult Put(TripEdit model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var noteService = new TripService(Guid.Parse(User.Identity.GetUserId())); var temp = noteService.GetTripById(model.TripID); if (temp == null) { return(NotFound()); } return(Ok(noteService.EditTrip(model))); }
public IHttpActionResult Delete(int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var noteService = new TripService(Guid.Parse(User.Identity.GetUserId())); var temp = noteService.GetTripById(id); if (temp == null) { return(NotFound()); } return(Ok(noteService.DeleteTrip(id))); }
public TripDTO Get(int id) { return(_service.GetTripById(id)); }