You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In many public service classes like NetworkService, we initialize a lot of dependencies inside the class, on different thread, which makes it difficult to mock them while writing tests. We would end up having to add dummy constructor for testing purpose only sometimes to make it testable. Can we find a more generic pattern for dependency injection like using factory classes, which provide dependencies and can be replaced with mocks during testing?
The text was updated successfully, but these errors were encountered:
In many public service classes like NetworkService, we initialize a lot of dependencies inside the class, on different thread, which makes it difficult to mock them while writing tests. We would end up having to add dummy constructor for testing purpose only sometimes to make it testable. Can we find a more generic pattern for dependency injection like using factory classes, which provide dependencies and can be replaced with mocks during testing?
The text was updated successfully, but these errors were encountered: