Esempio n. 1
0
        public void Step3_Submit_Returns_View()
        {
            // Arrange
            AnalysisController analysis = GetAnalysisController();

            // Act
            RedirectToRouteResult action = (RedirectToRouteResult)analysis.Step3("View Results", analysis.ControllerContext.HttpContext.User, 1);

            // Assert
            Assert.IsInstanceOf(typeof(ActionResult), action);
            Assert.AreEqual(action.RouteValues["action"], "Step4");
            Assert.AreEqual(action.RouteValues["controller"], "Analysis");

            action = (RedirectToRouteResult)analysis.Step3("View Results", analysis.ControllerContext.HttpContext.User, 2);

            // Assert
            Assert.IsInstanceOf(typeof(ActionResult), action);
            Assert.AreEqual(action.RouteValues["action"], "PermissionDenied");
            Assert.AreEqual(action.RouteValues["controller"], "Error");

            action = (RedirectToRouteResult)analysis.Step3("Back", analysis.ControllerContext.HttpContext.User, 2);

            // Assert
            Assert.IsInstanceOf(typeof(ActionResult), action);
            Assert.AreEqual(action.RouteValues["action"], "Step2b");
            Assert.AreEqual(action.RouteValues["controller"], "Analysis");
        }
Esempio n. 2
0
        public void Step3_Get_Returns_View()
        {
            // Arrange
            AnalysisController analysis = GetAnalysisController();

            // Act
            ActionResult view = analysis.Step3(analysis.ControllerContext.HttpContext.User, 1);

            // Assert
            Assert.IsInstanceOf(typeof(ViewResult), view);
        }