I am working on a project to create a wrapper library which will be used to interact with a web service provided by the client's IT team. The reason for this library is that we interact with this service across multiple projects and we wanted to create a single library to interface with the service. I am planning on how to structure the library classes so that I can abstract away the web service and insert a mock when unit testing. However, from what I have read, if I want to use DI, it needs to be setup by the project using my library and the rest of the team would prefer if they did not need to make too many changes to the existing projects, so I am trying to build this so that the existing project does not need to use DI for this one library. I do not want to have the existing project have to be concerned with passing the library an instance of the web service.Another thought I had was to use a Factory pattern to create instances of my classes. What I would do is have a constructor with regular parameters and a constructor with a parameter for a mock object. If the first constructor is called, it would use the web service. If the second constructor is called, it would use the mocked web service.The factory implementation that I described does not feel like the correct way to do what I want. Is there a way to do what I want with a more DI way of doing it?
Mocking third party web service
design patterns;object oriented design;dependency injection