1

I have a method. In that, I am reading the cookie like below,

string cookieData = Request.Cookies["XXXX"];

the issue is while writing a xUnit I am getting a null. Can anyone please help me with how to do this?

Udaya
  • 33
  • 4

1 Answers1

0

You should add a facade between your code and the reading of the cookie. Then you can mock the result from the facade. IE _myCookieFacade.Request("NameOfCookie)

andreasnico
  • 1,478
  • 14
  • 23