public ActionResult Reject(RejectViewingCommand command) { var handler = new RejectViewingCommandHandler(_context); handler.Handle(command); return(RedirectToAction("OnProperty", new { id = command.PropertyId })); }
public void SetUp() { _context = Substitute.For <IOrangeBricksContext>(); var viewings = new List <Models.Viewing> { new Viewing { Id = 1, PropertyId = 1, ViewingAt = new DateTime(2017, 1, 1, 9, 0, 0), BuyerUserId = "123", Status = ViewingStatus.Pending }, }; var mockViewingSet = Substitute.For <IDbSet <Models.Viewing> >() .Initialize(viewings.AsQueryable()); _context.Viewings.Returns(mockViewingSet); _handler = new RejectViewingCommandHandler(_context); }