Given the interfaces
class IFooable {
virtual void Fooable() = 0;
};
class IFoo {
virtual void Foo(IFooable* pFooable) = 0;
};
and cartoon false layout
class TMockFoo : public IFoo {
MOCK_METHOD1(Foo, void (IFooable*));
};
What is the easiest way to specify an action that invokes Fooable()an argument for a prepared method Foo()?
I tried
TMockFoo MockFoo;
ON_CALL(MockFoo, Foo(_))
.WithArg<0>(Invoke(&IFooable::Fooable));
but this does not compile because Invoke()with one argument it expects a free function, not a member function.
Usage boost::bindshould probably work, but not necessarily make the code too readable. Before writing a custom one Action, I wanted to check if I had disappeared something completely obvious.
source
share