Mocking HTTP current context identity
There are many places in the code in the project I’m working on where HttpContext.Current.User is used to get id of the currently logged in user. This can be tricky when it comes to unit testing functions using the HttpContext. One of the way to get around this is to mock the HttpContext by manually creating the identity. … [Read more…]
