A class to mock AutoMlConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type AutoMlClient
. To do so, construct an object of type AutoMlClient
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.
Returns |
Type |
Description |
Options |
|
virtual CreateDataset(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::automl::v1::Dataset > > |
|
virtual GetDataset(google::cloud::automl::v1::GetDatasetRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::automl::v1::GetDatasetRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::automl::v1::Dataset > |
|
virtual ListDatasets(google::cloud::automl::v1::ListDatasetsRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::automl::v1::ListDatasetsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::automl::v1::Dataset > |
|
virtual UpdateDataset(google::cloud::automl::v1::UpdateDatasetRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::automl::v1::UpdateDatasetRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::automl::v1::Dataset > |
|
virtual DeleteDataset(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::automl::v1::OperationMetadata > > |
|
virtual ImportData(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::automl::v1::OperationMetadata > > |
|
virtual ExportData(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::automl::v1::OperationMetadata > > |
|
virtual GetAnnotationSpec(google::cloud::automl::v1::GetAnnotationSpecRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::automl::v1::GetAnnotationSpecRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::automl::v1::AnnotationSpec > |
|
virtual CreateModel(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::automl::v1::Model > > |
|
virtual GetModel(google::cloud::automl::v1::GetModelRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::automl::v1::GetModelRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::automl::v1::Model > |
|
virtual ListModels(google::cloud::automl::v1::ListModelsRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::automl::v1::ListModelsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::automl::v1::Model > |
|
virtual DeleteModel(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::automl::v1::OperationMetadata > > |
|
virtual UpdateModel(google::cloud::automl::v1::UpdateModelRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::automl::v1::UpdateModelRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::automl::v1::Model > |
|
virtual DeployModel(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::automl::v1::OperationMetadata > > |
|
virtual UndeployModel(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::automl::v1::OperationMetadata > > |
|
virtual ExportModel(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::automl::v1::OperationMetadata > > |
|
virtual GetModelEvaluation(google::cloud::automl::v1::GetModelEvaluationRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::automl::v1::GetModelEvaluationRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::automl::v1::ModelEvaluation > |
|
virtual ListModelEvaluations(google::cloud::automl::v1::ListModelEvaluationsRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::automl::v1::ListModelEvaluationsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::automl::v1::ModelEvaluation > |
|