I have some classes(call it Class A) which I would like to unit test but it uses some classes(call it Class B) with some static methods.
To remove reference to these classes with static methods I have to refactor them to be instance methods and inject into Class A.
Issue is Class A has lots of services(Not only class B) its seems to depend on?
What is the best option in this scenario? Have a constructor that has a lot of parameters that can take in these services?
Or is there something wrong with my design the fact that class A has so many dependencies?
Thanks
Several dependencies are usually indicating a code smell. Your class is most likely breaking Single Responsibility Principle.
Try to break down the class into smaller classes.
Unit tests are a good quality indicator. Classes that are hard to test are often violating one or more of the SOLID principles.
Constructor injection is always the preferred way since it’s easy to tell what dependencies a class has.