Programming
Mocking IHttpContextAcessor
If you use IHttpContextAccessor in any services then you may need to mock it for unit tests. It’s quite a complicated class but in order to mock the request URL the below code can be used.
If you use IHttpContextAccessor in any services then you may need to mock it for unit tests. It’s quite a complicated class but in order to mock the request URL the below code can be used.