예제 #1
0
        public void Should_convert_to_RedirectToRouteResult()
        {
            ActionResult          result    = new RedirectToRouteResult(new RouteValueDictionary());
            RedirectToRouteResult converted = result.AssertActionRedirect();

            Assert.IsNotNull(converted);
        }
예제 #2
0
        public void ToAction_should_support_strongly_typed_controller_and_action()
        {
            ActionResult result = new RedirectToRouteResult(new RouteValueDictionary(new { controller = "PageHandler", action = "About" }));
            var          final  = result.AssertActionRedirect().ToAction <PageHandler>(c => c.About());

            Assert.That(final, Is.EqualTo(result));
        }
예제 #3
0
        public void ToAction_with_strongly_typed_controller_can_ignore_the_controller_suffix()
        {
            ActionResult result = new RedirectToRouteResult(new RouteValueDictionary(new { controller = "Fake", action = "About" }));
            var          final  = result.AssertActionRedirect().ToAction <FakeController>(c => c.About());

            Assert.That(final, Is.EqualTo(result));
        }
예제 #4
0
        public void Should_chain()
        {
            ActionResult result = new RedirectToRouteResult(new RouteValueDictionary(new { controller = "Home", action = "Index", id = 1 }));
            var          final  = result.AssertActionRedirect().ToController("Home").ToAction("Index").WithParameter("id", 1);

            Assert.That(final, Is.EqualTo(result));
        }