-
Notifications
You must be signed in to change notification settings - Fork 30
Home
gzc9047 edited this page Sep 28, 2014
·
5 revisions
Based on gmock, can mock global function, member function, class static function without change source code.
Here is the document and design notes host on OneNote.
Hello world:
string func() {
return "Non mocked.";
}
TEST(HelloWorld, First) {
EXPECT_CALL(*MOCKER(func), MOCK_FUNCTION()).Times(Exactly(1))
.WillOnce(Return("Hello world."));
EXPECT_EQ("Hello world.", func());
}
Prototype contains the basic code when I try to solve this problem.