How to write unit test for Program and Startup cs file for ASP.NET Core Web API app
you can extract the configuration out in separate calls and expose them into func<> which is you are custom created and write the unit test for them . TIt is not recommended to test the framework code. you should do testing for your code only not for the framework. I hope you get the point correctly.