I have the following interface :
public interface IOuputDestination
{
void Write(String s);
}
In my unit test, I mock it like so :
var outputDestination = A.Fake<IOutputDestination>();
What I want to do, is intercept the Write method so that it uses my custom implementation that I define in my test. Something like this :
String output = "";
A.CallTo(() => outputDestination.Write(A<String>.Ignored)).Action(s => output += s);
//Is something like this even possible ? ----^
Here the Action
method does not exist, but what I would like to happen is that any parameter passed into outputDestination.Write
be redirected to my custom action. Is this possible using FakeItEasy? If not, is there another mocking framework that allows this kind of behavior?