A class to mock ProjectsConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type ProjectsClient
. To do so, construct an object of type ProjectsClient
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 DisableXpnHost(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|
virtual DisableXpnResource(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|
virtual EnableXpnHost(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|
virtual EnableXpnResource(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|
virtual GetProject(google::cloud::cpp::compute::projects::v1::GetProjectRequest 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::projects::v1::GetProjectRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::cpp::compute::v1::Project > |
|
virtual GetXpnHost(google::cloud::cpp::compute::projects::v1::GetXpnHostRequest 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::projects::v1::GetXpnHostRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::cpp::compute::v1::Project > |
|
virtual GetXpnResources(google::cloud::cpp::compute::projects::v1::GetXpnResourcesRequest 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::projects::v1::GetXpnResourcesRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::cpp::compute::v1::ProjectsGetXpnResources > |
|
virtual ListXpnHosts(google::cloud::cpp::compute::projects::v1::ListXpnHostsRequest)
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::projects::v1::ListXpnHostsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::cpp::compute::v1::Project > |
|
virtual MoveDisk(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|
virtual MoveInstance(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|
virtual SetCloudArmorTier(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|
virtual SetCommonInstanceMetadata(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|
virtual SetDefaultNetworkTier(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|
virtual SetUsageExportBucket(google::cloud::cpp::compute::v1::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::cloud::cpp::compute::v1::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > |
|