In this simple example (ofcourse my real world problem is a tad more complex, although the basics are the same), how do I enforce tell dont ask to the max? Id like to maximize tell dont ask in the process method, in its current state its harder to mock and test.
public class Processor
{
public void Process()
{
var data = new Task1().DoStuff();
new Task2().DoStuffToData(data);
}
}
public class Task1
{
public Data DoStuff(){return new Data();}
}
public class Data {}
public class Task2
{
public void DoStuffToData(Data data){}
}
EDIT: Updated sample more DIish
public class Processor
{
public Processor(ITask1 task1, ITask2 task) {...}
public void Process()
{
var data = task1.DoStuff();
task2.DoStuffToData(data);
}
}