예제 #1
0
        public ActionResult OnProperty(int id)
        {
            var builder   = new ViewingsOnPropertyViewModelBuilder(_context);
            var viewModel = builder.Build(id);

            return(View(viewModel));
        }
예제 #2
0
        public ActionResult OnPropertyByMe(int id)
        {
            var builder   = new ViewingsOnPropertyViewModelBuilder(_context);
            var viewModel = builder.Build(id, User.Identity.GetUserId());

            return(View("OnProperty", viewModel));
        }
        public void BuildShouldReturnViewingsForProperty()
        {
            // Arrange
            var builder = new ViewingsOnPropertyViewModelBuilder(_context);

            // Act
            var viewModel = builder.Build(1);

            // Assert
            Assert.That(viewModel.Viewings.Count, Is.EqualTo(2));
        }
        public ActionResult MyViewings(int propertyId)
        {
            try
            {
                var builder   = new ViewingsOnPropertyViewModelBuilder(_context);
                var viewModel = builder.Build(propertyId);

                return(View(viewModel));
            }
            catch (Exception e)
            {
                return(View("Error", new HandleErrorInfo(e, GetType().Name, MethodBase.GetCurrentMethod().Name)));
            }
        }