Application developers may want to test their code with simulated responses, including errors, from an object of type ServiceManagerClient. To do so, construct an object of type ServiceManagerClient 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-04-17 UTC."],[[["This webpage details the `MockServiceManagerConnection` class, which is designed for simulating responses and errors when testing code that interacts with `ServiceManagerClient`."],["The class offers methods like `options()`, `ListServices()`, `GetService()`, and many others, all of which are implemented using gMock's `MOCK_METHOD()` for flexible testing."],["Application developers can use this mock class in conjunction with the Google Test framework to programmatically control the behavior of a `ServiceManagerClient` instance during testing, as demonstrated by the example, which is applicable to any `*Client` and `*Connection` pairing."],["The documentation lists various supported versions of this class, ranging from version `2.11.0` to `2.37.0-rc` (latest), with links to the documentation for each of them."],["The functions listed on the webpage, such as `CreateService` and `DeleteService`, and others, accept a parameter request, and return a particular type, depending on the function used."]]],[]]