Example #1
0
        public ActionResult Accept(AcceptViewingCommand command)
        {
            var handler = new AcceptViewingCommandHandler(_context);

            handler.Handle(command);

            return(RedirectToAction("OnProperty", new { id = command.PropertyId }));
        }
        public void HandleShouldAcceptViewing()
        {
            // Arrange
            var command = new AcceptViewingCommand
            {
                PropertyId = 1,
                ViewingId  = 1
            };

            // Act
            _handler.Handle(command);

            // Assert
            var viewing = _context.Viewings.First();

            Assert.That(viewing.Status, Is.EqualTo(ViewingStatus.Accepted));
        }