Thiru Prakash

Thiru Prakash

  • NA
  • 3
  • 2.8k

Mock Response.Cookies.Add(...) in MVC unit testing

Oct 1 2014 7:09 AM
The basic problem is that the controller I'm testing calls Response.Cookies.Add(…) but since the unit test is not in an HTTPContext, Response is null and I get an exception. Can someone give me an example. ?