public ActionResult Reject(RejectViewingCommand command) { var handler = new RejectViewingCommandHandler(_context); handler.Handle(command); return(RedirectToAction("OnProperty", new { id = command.PropertyId })); }
public void HandleShouldAcceptViewing() { // Arrange var command = new RejectViewingCommand { PropertyId = 1, ViewingId = 1 }; // Act _handler.Handle(command); // Assert var viewing = _context.Viewings.First(); Assert.That(viewing.Status, Is.EqualTo(ViewingStatus.Rejected)); }