public ActionResult BookingView(BookingViewCommand command) { var handler = new BookingViewCommandHandler(_context); var result = handler.Handle(command); var newBooking = result.Entity as Booking; if (result.Status) { TempData["BookingStatus"] = "Success"; } return(RedirectToAction("Index")); }
public void HandleShouldAddValidDateBooking() { //Arrange var command = new BookingViewCommand(); var property = GetMockProperty(1, "TestProperty"); _properties.Find(1).Returns(property); command.ViewDate = DateTime.Now; command.PropertyId = 1; //Actaul var result = _handler.Handle(command); //Assert Assert.IsTrue(result.Status); }