Let’s assume I have some method that executes CLI application. For example:
public string SomeMethod(string cmd)
{
var p = new ProcessStartInfo(cmd);
// processing execution results
return result;
}
How can I change this method to make it testable?
I see that I can split that method into 2:
1. Executes CLI app and passes the execution result to the second
2. Processes the results in some way and returns the answer
May be some other handy ways?
Well, I’ve decided to implement that as i offered in the question.