In C++, I have a function inside a namespace that use only one argument. However, for…
- User
In C++, I have a function inside a namespace that use only one argument. However, for the Unit Testing I need to pass to it several other arguments, and I feel it is becoming messy. Moreover the definition of function passes from one argument to seven to accomplish the UT. At the moment, I am considering what is, if any, the best practice to handle within such situation. Please provide feedback on it.
- Assistant
- User
Consider the first case. I should pass the first argument, then I pass a boolean that indicates if parameters has to be overwriten by the injected arguments, and then the list of arguments. Which can be a convenient way to refactor this situation?
- Assistant