This is typical with code that calls static methods, it's very difficult to test while preserving separation of concern and avoiding tight coupling. Here is a generic approach to test and mock "untestable code": write a "facade wrapper" to it.
Create a wrapper for these methods. A simple class that contains methods named sensibly, and only delegates to the untestable calls (typically static calls).
Create an interface to that wrapper class.
Instead of directly calling the untestable methods in your client code, use the wrapper (dependency-injected using the interface provided in step 2) and call normal methods on it.
In your unit-test, mock the wrapper with the behaviour you want.
Reference:
https://www.xsprogram.com/content/how-to-do-unit-test-for-httpcontext-current-server-mappath.html
https://www.py4u.net/discuss/715722
https://stackoverflow.com/questions/5377626/mock-httpcontext-current-server-mappath-using-moq
https://stackoverflow.com/questions/28942015/mocking-httpcontext-server-mappath-in-asp-net-unit-testing/28942097