Пример #1
0
        public void RedirectToAction_Action_Controller_Route_NotAuthorized_RedirectsToDefault()
        {
            controller.IsAuthorizedFor($"{areaName}/Controller/Action").Returns(false);

            Object expected = RedirectToDefault(controller);
            Object actual   = controller.RedirectToAction("Action", "Controller", new { id = 1 });

            Assert.Same(expected, actual);
        }
Пример #2
0
        protected RedirectToActionResult RedirectToAction(AController baseController, String action, String controller)
        {
            RedirectToActionResult result = new(null, null, null);

            baseController.RedirectToAction(action, controller).Returns(result);

            return(result);
        }
Пример #3
0
        protected RedirectToActionResult RedirectToAction(AController controller, String action)
        {
            RedirectToActionResult result = new(null, null, null);

            controller.RedirectToAction(action).Returns(result);

            return(result);
        }