Ejemplo n.º 1
0
 public void Should_remove_reference_type_parameters_from_the_route_values()
 {
     var someObject = new AnotherTestController.SomeObject {One = 1, Two = "two"};
     var controller = new AnotherTestController();
     var redirectToRouteResult = controller.RedirectToAction(c => c.AnotherAction(someObject));
     Assert.That(redirectToRouteResult.RouteValues.ContainsKey("obj"), Is.False);
 }
Ejemplo n.º 2
0
 public void Should_not_remove_null_parameters_from_the_route_values()
 {
     var someObject = new AnotherTestController.SomeObject {One = 1, Two = "two"};
     var controller = new AnotherTestController();
     var redirectToRouteResult = controller.RedirectToAction(c => c.AnotherAction(someObject));
     Assert.That(redirectToRouteResult.RouteValues["obj"], Is.Null);
 }
Ejemplo n.º 3
0
        public void Should_store_all_parameters_in_the_action_in_TempData()
        {
            var someObject = new AnotherTestController.SomeObject {One = 1, Two = "two"};
            var controller = new AnotherTestController();
            var redirectToRouteResult = controller.RedirectToAction(c => c.AnotherAction(someObject));

            controller.TempData[PassParametersDuringRedirectAttribute.RedirectParameterPrefix + "obj"].ShouldEqual(someObject);
        }