Mock the results of a ExecuteQuery() or Read() operation.
More...
#include <google/cloud/spanner/mocks/mock_spanner_connection.h>
|
| MOCK_METHOD (StatusOr< spanner::Row >, NextRow,(),(override)) |
|
| MOCK_METHOD (absl::optional< google::spanner::v1::ResultSetMetadata >, Metadata,(),(override)) |
|
| MOCK_METHOD (absl::optional< google::spanner::v1::ResultSetStats >, Stats,(),(const, override)) |
|
virtual StatusOr< spanner::Row > | NextRow ()=0 |
| Returns the next row in the stream. More...
|
|
virtual absl::optional< google::spanner::v1::ResultSetMetadata > | Metadata ()=0 |
| Returns metadata about the result set, such as the field types and the transaction id created by the request. More...
|
|
virtual absl::optional< google::spanner::v1::ResultSetStats > | Stats () const =0 |
| Returns statistics about the result set, such as the number of rows, and the query plan used to compute the results. More...
|
|
Mock the results of a ExecuteQuery() or Read() operation.
- See also
- Mocking the Cloud Spanner C++ Client with Google Mock for an example using this class.
◆ Metadata()
virtual absl::optional< google::spanner::v1::ResultSetMetadata > google::cloud::spanner::ResultSourceInterface::Metadata |
( |
| ) |
|
|
pure virtualinherited |
◆ MOCK_METHOD() [1/3]
google::cloud::spanner_mocks::MockResultSetSource::MOCK_METHOD |
( |
absl::optional< google::spanner::v1::ResultSetMetadata > |
, |
|
|
Metadata |
, |
|
|
() |
, |
|
|
(override) |
|
|
) |
| |
◆ MOCK_METHOD() [2/3]
google::cloud::spanner_mocks::MockResultSetSource::MOCK_METHOD |
( |
absl::optional< google::spanner::v1::ResultSetStats > |
, |
|
|
Stats |
, |
|
|
() |
, |
|
|
(const, override) |
|
|
) |
| |
◆ MOCK_METHOD() [3/3]
◆ NextRow()
Returns the next row in the stream.
- Returns
- if the stream is interrupted due to a failure the
StatusOr<spanner::Row>
contains the error. The function returns a successful StatusOr<>
with an empty spanner::Row
to indicate end-of-stream.
◆ Stats()
virtual absl::optional< google::spanner::v1::ResultSetStats > google::cloud::spanner::ResultSourceInterface::Stats |
( |
| ) |
const |
|
pure virtualinherited |