Is there any ways to write unit test for Program cs file for ASP.NET Core Web API and similarly for startup class, just to show more code coverage for the entire app? It's shows 0% coverage for now.
1 Answer
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.
1 Comment
user584018
Thanks @Priyanshu. I get the point, but do you mind to share bit code as well.

Mainjust like any other method, whether there's any value in doing so is up to you. In order to ensure the application starts up properly is typically done by integration tests or smoke tests.