Is there a way to pass the arguments of a faked method call on to the faked version?
Let\\\'s say I have -
class Factory {
public:
int Build(int argument) { return argument; }
};
Factory * fake = FAKE<Factory>();
WHEN_CALLED(fake->Build()).DoStaticOrGlobalInstead(<some version that accepts the incoming argument>);
so that when I call fake->Build(10), I can act on the \\\"10\\\" instead of always returning the same value.
Ideally, what I want to do is something like this (obviously this is a contrived example, the real situation is more complex):
WHEN_CALLED(fake->Build()).DoStaticOrGlobalInstead([](int x) { return x*x; });
This functionality - a one-line mocked version of the original class - seems to me sort of central to the concept of mocking - so am I missing something obvious on how to use Typemock to accomplish this?
Thanks.