Set the IHostingEnvironment in unit test
You can mock the IHostEnvironment using a mocking framework if needed or create a fake version by implementing the interface. Give a class like this… public class MyClass { protected IHostingEnvironment HostingEnvironment { get;private set; } public MyClass(IHostingEnvironment host) { HostingEnvironment = host; } } You can setup a unit test example using Moq… public … Read more