0
Answer

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

Thiru Prakash

Thiru Prakash

10y
1.2k
1
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. ?