Class separation
I've got a console app that does a lot of heavy lifting. Let's say it's got a service class (that performs http calls) as a dependency and the main class is calling it a multitude of times. The unit testing for the main class of the console app is becoming huge. Is it a good approach to just create a class that aggregates all the calls to the service class?
4 Replies
without knowing what the calls do, no
do you have an example of the code you're trying to refactor?
Task<string?> SetProperty(string userID, string property, string value);
This method gets called 9 times with different values
It's for the same user but different properties
making another service to abstract that would make sense, as long as the operations are all related (like a UserService)
Thanks 🙏