Class MockNetworksConnection (2.21.0)

A class to mock NetworksConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type NetworksClient. To do so, construct an object of type NetworksClient 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 AddPeering(google::cloud::cpp::compute::networks::v1::AddPeeringRequest 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::cpp::compute::networks::v1::AddPeeringRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual DeleteNetwork(google::cloud::cpp::compute::networks::v1::DeleteNetworkRequest 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::cpp::compute::networks::v1::DeleteNetworkRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual GetNetwork(google::cloud::cpp::compute::networks::v1::GetNetworkRequest 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::cpp::compute::networks::v1::GetNetworkRequest const &
Returns
TypeDescription
StatusOr< google::cloud::cpp::compute::v1::Network >

virtual GetEffectiveFirewalls(google::cloud::cpp::compute::networks::v1::GetEffectiveFirewallsRequest 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::cpp::compute::networks::v1::GetEffectiveFirewallsRequest const &
Returns
TypeDescription
StatusOr< google::cloud::cpp::compute::v1::NetworksGetEffectiveFirewallsResponse >

virtual InsertNetwork(google::cloud::cpp::compute::networks::v1::InsertNetworkRequest 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::cpp::compute::networks::v1::InsertNetworkRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual ListNetworks(google::cloud::cpp::compute::networks::v1::ListNetworksRequest)

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::cpp::compute::networks::v1::ListNetworksRequest
Returns
TypeDescription
StreamRange< google::cloud::cpp::compute::v1::Network >

virtual ListPeeringRoutes(google::cloud::cpp::compute::networks::v1::ListPeeringRoutesRequest)

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::cpp::compute::networks::v1::ListPeeringRoutesRequest
Returns
TypeDescription
StreamRange< google::cloud::cpp::compute::v1::ExchangedPeeringRoute >

virtual PatchNetwork(google::cloud::cpp::compute::networks::v1::PatchNetworkRequest 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::cpp::compute::networks::v1::PatchNetworkRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual RemovePeering(google::cloud::cpp::compute::networks::v1::RemovePeeringRequest 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::cpp::compute::networks::v1::RemovePeeringRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual SwitchToCustomMode(google::cloud::cpp::compute::networks::v1::SwitchToCustomModeRequest 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::cpp::compute::networks::v1::SwitchToCustomModeRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual UpdatePeering(google::cloud::cpp::compute::networks::v1::UpdatePeeringRequest 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::cpp::compute::networks::v1::UpdatePeeringRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >