I have a scenario like below:
auto App::OnMethod() -> ::std::string<>
{
::std::string <> vRslt{ ::Service::Daemon::Run(*this, *this) };
return(vRslt);
}
I would like to write unit test for OnMethod, and I want to use gtest/gmock to create a mock for ::Service::Daemon::Run(*this, *this). This mock will return “SUCCESS”. However, I do not know how to mock for ::Service::Daemon::Run(*this, *this).
I appreciate for anyone guide me how to do that.
Thank you so much!
New contributor
Hoc Huynh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.