I am unable to unit test one of my functions that contains HttpContext.Current.Request.LogonUserIdentity.Name
The error that I get is because LogonUserIdentity is null.
I added this in my unit test in order to set a value for HttpContext.Current because that was also null:
HttpContext.Current = new HttpContext(
new HttpRequest("", "http://localhost:8609", ""),
new HttpResponse(new StringWriter())
);
How can I assign a value to
LogonUserIdentityso that I can test my function?