Why Need to Inject Controller Dependency? | ASP.NET Interview Question

, ,
In real life application development, almost all ASP.NET MVC applications are needed to inject its dependent component. Components can be created directly inside the controller instead of injecting them. In that case, the controller will be strongly coupled on those components. If any component's implementation is changed or new version of that component is released, then the controller class itself has to be changed. You cannot do unit test of those controllers independently (within isolation). You cannot take mocking features from unit testing framework. Without mocking, you cannot do unit test of your code in isolated environment.