Ejemplo n.º 1
0
        public void Index_Redirects_To_Add_Jobsearch_Action_When_User_Has_No_Job_Searches()
        {
            // Setup
            User user = new User {
                Id = 20, JobSearches = new List <JobSearch>()
            };
            var userByIdMock = new Mock <UserByIdQuery>(null);

            userByIdMock.Setup(x => x.Execute()).Returns(user);
            HomeController controller = new HomeController(userByIdMock.Object, _serviceFactory.Object, null);

            controller.CurrentUserId = 20;

            // Act
            ActionResult result = controller.Index();

            // Verify
            result.AssertActionRedirect().ToController("JobSearch").ToAction("Add");
        }
Ejemplo n.º 2
0
 public void then_it_should_redirect_to_the_dashboard()
 {
     _result.AssertActionRedirect().ToAction <DashboardController>(c => c.Index());
 }
Ejemplo n.º 3
0
 public void then_it_redirects_to_the_view_page()
 {
     _result.AssertActionRedirect().ToAction <TicketController>(c => c.ViewTicket(TestTicket.TicketID));
 }