public void Should_not_remove_string_parameters_from_the_route_values() { var controller = new AnotherTestController(); var redirectToRouteResult = controller.RedirectToAction(c => c.YetAnotherAction("asdf")); Assert.That(redirectToRouteResult.RouteValues.ContainsKey("s"), Is.True); Assert.That(redirectToRouteResult.RouteValues["s"], Is.EqualTo("asdf")); }
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); }
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); }
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); }