Application developers may want to test their code with simulated responses, including errors, from an object of type PagesClient. To do so, construct an object of type PagesClient with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.
See Also
This example for how to test your application with GoogleTest. While the example showcases types from the BigQuery library, the underlying principles apply for any pair of *Client and *Connection.
Functions
virtual options()
This function is implemented using gMock's MOCK_METHOD().
Consult the gMock documentation to use this mock in your tests.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-12 UTC."],[[["The latest version of the `MockPagesConnection` class is 2.37.0-rc, with numerous previous versions available for reference, ranging down to version 2.11.0."],["This class is designed to allow application developers to test their code using simulated responses from a `PagesClient`, enabling them to program the behavior of the mock using the Google Test framework."],["The `MockPagesConnection` class has functions that implement gMock's `MOCK_METHOD()`, allowing for the simulation of various actions, like `ListPages`, `GetPage`, `CreatePage`, `UpdatePage`, and `DeletePage`, along with operations for locations and other long running actions."],["This mock class provides virtual functions for handling various requests related to pages and locations, such as `ListPages`, `GetPage`, `ListLocations`, and `GetLocation`, each with specified parameter types and return values."],["There is an example available in the documentation on how to test your application with GoogleTest by following the example that showcases types from the BigQuery library, but the same principles are applicable for any `*Client` and `*Connection`."]]],[]]