Application developers may want to test their code with simulated responses, including errors, from an object of type CloudMemcacheClient. To do so, construct an object of type CloudMemcacheClient 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-03-05 UTC."],[[["This document outlines the `MockCloudMemcacheConnection` class, which is designed for application developers to simulate responses and errors when testing code interacting with `CloudMemcacheClient`."],["The `MockCloudMemcacheConnection` class provides mocked versions of various functions, such as `ListInstances`, `GetInstance`, `CreateInstance`, `DeleteInstance`, and more, all implemented using gMock's `MOCK_METHOD()`."],["You can program the behavior of the mock by using the Google Test framework functions and consulting the gMock documentation to properly implement it in your testing."],["The documentation details the parameters, return types, and descriptions for each mocked function, providing a comprehensive overview of how to interact with the class for testing purposes."],["A practical example is referenced, showcasing how to apply similar mocking principles using GoogleTest, even though it demonstrates types from the BigQuery library, the logic remains consistent across different `*Client` and `*Connection` pairs."]]],[]]