In my Controller Action I set Cookie with Response.SetCookie(myCookie) method.
In my Unit Test method I would like to use Mock or better Stub to examine if all parameters have been set correctly. I am using MvcContrib TestHelper to setup HttpContext but I don’t know how to pass my fake Response object to it. I am using Moq and MvcContrib.
In my Controller Action I set Cookie with Response.SetCookie(myCookie) method. In my Unit Test
Share
You need to mock HttpContext property on TestControllerBuilder yourself. HttContext is marked protected so your test class needs to inherit from TestControllerBuilder to be able to set it. I did it like this: