Are you looking for something similar? (unverified, just typed it in the answer window)
var cookies = new HttpCookieCollection();
controller.ControllerContext = new FakeControllerContext(controller, cookies);
var result = controller.TestCookie() as ViewResult;
Assert.AreEqual("somevaluethatshouldbethere", cookies["somecookieitem"].Value);
Like in, did you mean that you want to check the spelling of the cookie instead of reading it? Please make your request more clear if possible :)
source
share