示例#1
0
        public ActionResult Reject(RejectViewingCommand command)
        {
            var handler = new RejectViewingCommandHandler(_context);

            handler.Handle(command);

            return(RedirectToAction("OnProperty", new { id = command.PropertyId }));
        }
示例#2
0
        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));
        }