lundi 7 octobre 2019

How can I Unit Test Dependency Resolve for .Net Core Web Application?

I want to write a Unit test that will test to see if all DI services can/will be resolved at runtime.

We have 2 .net core web apps. App A and App B, and a shared BLL DLL that both web apps reference that we add services to.

When we create a new service in the BLL project for the web app we are currently working on (let’s say App A) we will include the Service in our Startup > ConfigureServices method and register it with the DI container as we should but may forget to do the same with App B only to realize at runtime that dependency resolution will fail for it.

How can we protect against this?

Aucun commentaire:

Enregistrer un commentaire