Ejemplo n.º 1
0
        public void OnActionExecuted_should_store_value_type_parameters_where_the_value_type_cannot_be_converted_from_string()
        {
            var someValueType = new SomeValueTypeWhichCannotBeConvertedFromString(1, "two");

            var context = new ActionExecutedContext
            {
                Result     = new RedirectToRouteResult <SampleController>(x => x.Action3(someValueType)),
                Controller = new SampleController()
            };

            _filter.OnActionExecuted(context);

            context.Controller.TempData[PassParametersDuringRedirectAttribute.RedirectParameterPrefix + "viewModel"].ShouldEqual(someValueType);
        }
 public ActionResult Action3(SomeValueTypeWhichCannotBeConvertedFromString viewModel)
 {
     return View(viewModel);
 }
        public void OnActionExecuted_should_store_value_type_parameters_where_the_value_type_cannot_be_converted_from_string()
        {
            var someValueType = new SomeValueTypeWhichCannotBeConvertedFromString(1, "two");

            var context = new ActionExecutedContext
            {
                Result = new RedirectToRouteResult<SampleController>(x => x.Action3(someValueType)),
                Controller = new SampleController()
            };

            _filter.OnActionExecuted(context);

            context.Controller.TempData[PassParametersDuringRedirectAttribute.RedirectParameterPrefix + "viewModel"].ShouldEqual(someValueType);
        }
Ejemplo n.º 4
0
 public ActionResult Action3(SomeValueTypeWhichCannotBeConvertedFromString viewModel)
 {
     return(View(viewModel));
 }