EXPECT_CALL(_http, post(testing::_, testing::_, testing::_)).WillOnce(testing::Invoke(Argument<2>.complete(200, ""));
My idea is to invoke a function complete(int, string) on the 3rd argument passed in post call.
Could anyone help?
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Mocking Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googlemock+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/googlemock/929176b3-7996-4d2d-8e07-6873c330ef01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
EXPECT_CALL(_http, post(testing::_, testing::_, testing::_))
.WillOnce(testing::WithArg<2>(testing::Invoke(
[] (const std::shared_ptr <HttpCallback> &callback)
{
callback->complete(200, "");
})));
and it worked.