Mocking HttpContext in ASPNET Core
Apr 18, 2021 · 5 min read · If you have been developing web apps with C# and the .NET framework for any length of time, chances are, you are familiar with the following code snippet. var userName = HttpContext.Current.User.Identity.Name; The code is simple. We've received a web...
NNicklas commented