Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

1
How do i achieve this via mocking for unit tests
Post Flair (click to view more posts with a particular flair)
Post Body

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?

Author
Account Strength
50%
Account Age
2 years
Verified Email
Yes
Verified Flair
No
Total Karma
213
Link Karma
197
Comment Karma
16
Profile updated: 3 days ago
Posts updated: 3 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 months ago