Application developers may want to test their code with simulated responses, including errors, from an object of type CompletionClient. To do so, construct an object of type CompletionClient 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-05-07 UTC."],[[["This webpage provides access to various versions of the `MockCompletionConnection` class, with version 2.37.0-rc being the latest release candidate."],["The `MockCompletionConnection` class allows developers to test their applications by simulating responses, including errors, from a `CompletionClient` object."],["This mock class utilizes `gMock`'s `MOCK_METHOD()` functionality for its virtual functions, which can be programmed through the Google Test framework."],["The `MockCompletionConnection` class has virtual functions like `options()`, `CompleteQuery()`, and `GetOperation()`, which are designed to be used in testing."],["The content on the page is part of a larger reference within the `talent` module, `v4` package, within the `cpp` library of Google Cloud."]]],[]]