When placed on a controller or action, this attribute will ensure that reference-type-parameters (or value types which cannot be converted from a string) passed into RedirectToAction<T>() will get passed to the controller or action that this attribute is placed on.
Наследование: System.Web.Mvc.ActionFilterAttribute
        public void Establish_context()
        {
            _attribute = new PassParametersDuringRedirectAttribute();
            _controller = new SampleController();
            _filterContext = new ActionExecutingContext();
            _filterContext.ActionParameters = new Dictionary<string, object>();
            _filterContext.Controller = _controller;
            _someObject = new SomeObject {One = 1, Two = "two"};

            _controller.TempData[PassParametersDuringRedirectAttribute.RedirectParameterPrefix + "param1"] = _someObject;
            _controller.TempData[PassParametersDuringRedirectAttribute.RedirectParameterPrefix + "param2"] = 5;
        }
 public void Setup()
 {
     _filter = new PassParametersDuringRedirectAttribute();
     _someReferenceType = new SomeReferenceType {One = 1, Two = "two"};
 }
        public void Setup()
        {
            _filter = new PassParametersDuringRedirectAttribute();
            _someObject = new SomeObject { One = 1, Two = "two" };

            _fakeActionExecutingContext = new ActionExecutingContext()
                {
                    Controller = new SampleController(),
                    ActionParameters = new Dictionary<string, object>(),
                    ActionDescriptor = GetActionDescriptorStubForIndexAction()
                };

            var stubContext = MockRepository.GenerateStub<HttpContextBase>();
            var stubRequest = MockRepository.GenerateStub<HttpRequestBase>();
            stubRequest.RequestType = "GET";

            stubContext.Stub(s => s.Request).Return(stubRequest);
            _fakeActionExecutingContext.HttpContext = stubContext;
        }
 public void Setup()
 {
     _filter = new PassParametersDuringRedirectAttribute();
     _someObject = new SomeObject {One = 1, Two = "two"};
 }