Application developers may want to test their code with simulated responses, including errors, from an object of type CompletionServiceClient. To do so, construct an object of type CompletionServiceClient 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-14 UTC."],[[["This document details the `MockCompletionServiceConnection` class, which is designed to facilitate testing of code that uses the `CompletionServiceClient` by simulating responses and behaviors."],["The latest version of the `MockCompletionServiceConnection` class is `2.37.0-rc`, and it includes the following classes: 2.36.0, 2.35.0, 2.34.0, 2.33.0, 2.32.0, 2.31.0, 2.30.0, 2.29.0, 2.28.0, 2.27.0, 2.26.0, 2.25.1, 2.24.0, 2.23.0, 2.22.0, 2.21.0, 2.20.0, 2.19.0, 2.18.0, 2.17.0, 2.16.0, 2.15.1."],["The `MockCompletionServiceConnection` class uses gMock's `MOCK_METHOD()` to implement its functions, allowing developers to utilize the gMock documentation for testing purposes."],["This class supports various operations such as `CompleteQuery`, `ImportSuggestionDenyListEntries`, `PurgeSuggestionDenyListEntries`, `ImportCompletionSuggestions`, `PurgeCompletionSuggestions`, `ListOperations`, `GetOperation`, and `CancelOperation`."],["The document provides links to examples to help application developers understand how to utilize this mock class to test their code with the Google Test framework."]]],[]]