Closed TrueWodzu closed 2 years ago
Hi,
I wanted to ask, because I haven't seen such example. If I have a function like this:
bool MyFunction(MyCallback callback) { callback(param1, param2); return true; }
Is it possible to fake it in a way that it will call the callback which is inside of it?
Thanks.
Yes, see https://github.com/eranpeer/FakeIt/wiki/Quickstart You can use the lambda expression forms:
When(Method(mock,foo)).Do([](int a)->int{ ... }); When(Method(mock,foo)).AlwaysDo([](int a)->int{ ... });
Hi,
I wanted to ask, because I haven't seen such example. If I have a function like this:
bool MyFunction(MyCallback callback) { callback(param1, param2); return true; }
Is it possible to fake it in a way that it will call the callback which is inside of it?
Thanks.