Class MockAgentsConnection (2.23.0-rc)

A class to mock AgentsConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type AgentsClient. To do so, construct an object of type AgentsClient 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
TypeDescription
Options

virtual GetAgent(google::cloud::dialogflow::v2::GetAgentRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::dialogflow::v2::GetAgentRequest const &
Returns
TypeDescription
StatusOr< google::cloud::dialogflow::v2::Agent >

virtual SetAgent(google::cloud::dialogflow::v2::SetAgentRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::dialogflow::v2::SetAgentRequest const &
Returns
TypeDescription
StatusOr< google::cloud::dialogflow::v2::Agent >

virtual DeleteAgent(google::cloud::dialogflow::v2::DeleteAgentRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::dialogflow::v2::DeleteAgentRequest const &
Returns
TypeDescription
Status

virtual SearchAgents(google::cloud::dialogflow::v2::SearchAgentsRequest)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::dialogflow::v2::SearchAgentsRequest
Returns
TypeDescription
StreamRange< google::cloud::dialogflow::v2::Agent >

virtual TrainAgent(google::cloud::dialogflow::v2::TrainAgentRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::dialogflow::v2::TrainAgentRequest const &
Returns
TypeDescription
future< StatusOr< google::protobuf::Struct > >

virtual ExportAgent(google::cloud::dialogflow::v2::ExportAgentRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::dialogflow::v2::ExportAgentRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::dialogflow::v2::ExportAgentResponse > >

virtual ImportAgent(google::cloud::dialogflow::v2::ImportAgentRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::dialogflow::v2::ImportAgentRequest const &
Returns
TypeDescription
future< StatusOr< google::protobuf::Struct > >

virtual RestoreAgent(google::cloud::dialogflow::v2::RestoreAgentRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::dialogflow::v2::RestoreAgentRequest const &
Returns
TypeDescription
future< StatusOr< google::protobuf::Struct > >

virtual GetValidationResult(google::cloud::dialogflow::v2::GetValidationResultRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::dialogflow::v2::GetValidationResultRequest const &
Returns
TypeDescription
StatusOr< google::cloud::dialogflow::v2::ValidationResult >