Tips & tricks for unit testing in .NET Core 3: Mocking IHttpContextAccessor

added by DotNetKicks
2/3/2020 4:27:04 PM

222 Views

I wanted to write this article because I recently came across an interesting test case. This involved testing a factory that selected a service instance in the DI system from a service name. To be able to test this case, I had to mock the IHttpContextAccessor interface and a little bit more ...


0 comments