I've got a method in a class that's writing to some string, which calls another method which does the same. Something like:
void foo() {
a += "xyx";
bar();
}
void bar() {
a += "abc";
}
For unit testing purposes, I want to test foo and bar separately. Is there any way to prevent bar from being run when I call foo() or to replace it with another method?