// GET: BookingRequest/Details/5 public ActionResult Details(int id) { var bookingrequest = _bookingRequestRepo.FindById(id); var model = _mapper.Map <BookingRequestViewModel>(bookingrequest); return(View(model)); }
public async Task CancelBooking_Should_SetCancelledToTrue() { // Arrange var clientId = Guid.NewGuid(); var customerId = Guid.NewGuid(); var entity = await repo.Create(new BookingRequest { Confirmed = true }, customerId, clientId); var sut = new BookingRequestService(repo, null); // Act await sut.CancelBooking(entity.Id, clientId); // Assert var result = await repo.FindById(entity.Id, clientId); Assert.True(result.Cancelled); }
public async Task <BookingRequest> GetBooking(Guid id, Guid clientId) { return(await bookings.FindById(id, clientId)); }