How are you going to pretend like this:
public interface IBlah
{
Func<T, bool> ApplyFilter<T>(Func<T, bool> predicate) where T:IMessage;
}
I would like the fake to simply return the argument without any change. However, I would like to verify that the fake was called exactly once. An example of use is given below:
public class Something
{
public Something(IBlah blah) { _blah = blah; }
public bool DoSomething(SomeValue m, Func<SomeValue, bool> predicate)
{
Func<SomeValue, bool> handler = _blah.ApplyFilter(predicate);
return handler(m);
}
}
i.e. the fake should act like a passage, but I should also be able to verify that it was used.
What is the best way to do this?
[Please don't worry about a far-fetched example ... there are a lot of things going on under the covers, but I simplified it to the example above.]
ashic source
share