Inheritance: EntityBase
Beispiel #1
0
        public void ReturnToLastPage_Returns_RedirectToRouteResult_For_Current_Page_If_ReturnUrl_Missing()
        {
            // Arrange
            Page expected = new Page();
            IdentitySource source = CreateIdentitySource();
            ControllerContext context = Mockery.CreateMockControllerContext();
            context.HttpContext.GetPortalContext().ActivePage = expected;

            // Act
            ActionResult result = source.ReturnToLastPage(context);

            // Assert
            ResultAssert.IsRedirectToRoute(result, new { controller = "Page", action = "View", page = expected });
        }
Beispiel #2
0
        public void ReturnToLastPage_Returns_RedirectToRouteResult_For_Current_Page_If_ReturnUrl_Invalid()
        {
            // Arrange
            Page expected = new Page();
            IdentitySource source = CreateIdentitySource();
            ControllerContext context = Mockery.CreateMockControllerContext();
            context.HttpContext.GetPortalContext().ActivePage = expected;
            context.HttpContext.Request.QueryString["returnUrl"] = "http://localhost:foo";

            // Act
            ActionResult result = source.ReturnToLastPage(context);

            // Assert
            ResultAssert.IsRedirectToRoute(result, new {controller = "Page", action = "View", page = expected});
        }