This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I have a templated class as below: ``` template<typename R, uint32_t Id> class Foo { public:
static void callAsync(R req, completion_handler handler); }; ```
There is a separate file with instantiation of all of Foo, e.g
typedef Foo<A, 1> FooA;
typedef Foo<B, 2> FooB;
and so on, there could be many
And finally these are used inside a class method:
void Bar::doA(A req)
{
//...
FooA::callAsync(req);
}
Now i want to mock the callAsync(e.g with gmock) to call my completion_handler for testing. I do not however want to completely mock Bar::doA
as it has lots of other logic that i want to be tested.
How do i do it?
Subreddit
Post Details
- Posted
- 5 months ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/cpp_questio...