Class MockSnapshotsConnection (2.15.1)

A class to mock SnapshotsConnection.

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

virtual GetSnapshots(google::cloud::cpp::compute::snapshots::v1::GetSnapshotsRequest 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::cpp::compute::snapshots::v1::GetSnapshotsRequest const &
Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::Snapshot >

virtual GetIamPolicy(google::cloud::cpp::compute::snapshots::v1::GetIamPolicyRequest 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::cpp::compute::snapshots::v1::GetIamPolicyRequest const &
Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::Policy >

virtual InsertSnapshots(google::cloud::cpp::compute::snapshots::v1::InsertSnapshotsRequest 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::cpp::compute::snapshots::v1::InsertSnapshotsRequest const &
Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual ListSnapshots(google::cloud::cpp::compute::snapshots::v1::ListSnapshotsRequest)

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::cpp::compute::snapshots::v1::ListSnapshotsRequest
Returns
Type Description
StreamRange< google::cloud::cpp::compute::v1::Snapshot >

virtual SetIamPolicy(google::cloud::cpp::compute::snapshots::v1::SetIamPolicyRequest 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::cpp::compute::snapshots::v1::SetIamPolicyRequest const &
Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::Policy >

virtual SetLabels(google::cloud::cpp::compute::snapshots::v1::SetLabelsRequest 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::cpp::compute::snapshots::v1::SetLabelsRequest const &
Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual TestIamPermissions(google::cloud::cpp::compute::snapshots::v1::TestIamPermissionsRequest 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::cpp::compute::snapshots::v1::TestIamPermissionsRequest const &
Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::TestPermissionsResponse >