public void RedirectToLocal_NotLocalUrl_RedirectsToDefault()
        {
            controller.Url.IsLocalUrl("www.test.com").Returns(false);

            Object expected = RedirectToDefault(controller);
            Object actual   = controller.RedirectToLocal("www.test.com");

            Assert.Same(expected, actual);
        }
Example #2
0
        public void RedirectToLocal_RedirectsToDefaultIfUrlIsNotLocal()
        {
            controller.When(sub => sub.RedirectToDefault()).DoNotCallBase();
            controller.RedirectToDefault().Returns(new RedirectToRouteResult(new RouteValueDictionary()));

            ActionResult actual   = controller.RedirectToLocal("http://www.test.com");
            ActionResult expected = controller.RedirectToDefault();

            Assert.AreSame(expected, actual);
        }