Namespace google::cloud::spanner_mocks (2.21.0)

Define classes to mock the Cloud Spanner C++ client APIs.

Classes

MockConnection

An inlined versioned namespace to avoid dependency diamonds.

MockDatabaseAdminConnection

A class to mock google::cloud::spanner::DatabaseAdminConnection.

MockInstanceAdminConnection

A class to mock google::cloud::spanner::InstanceAdminConnection.

MockResultSetSource

Mock the results of a ExecuteQuery() or Read() operation.

Functions

MakeRow(std::vector< std::pair< std::string, spanner::Value > >)

Creates a spanner::Row with the specified column names and values.

This overload accepts a vector of pairs, allowing the caller to specify both the column names and the spanner::Value that goes in each column.

This function is intended for application developers who are mocking the results of a Client::ExecuteQuery call.

Parameter
NameDescription
pairs
Returns
TypeDescription
spanner::Row

MakeRow(Ts &&...)

Creates a spanner::Row with spanner::Values created from the given arguments and with auto-generated column names.

This overload accepts a variadic list of arguments that will be used to create the spanner::Values in the row. The column names will be implicitly generated, the first column being "0", the second "1", and so on, corresponding to the argument's position.

This function is intended for application developers who are mocking the results of a Client::ExecuteQuery call.

Parameters
NameDescription
ts
typename...
Returns
TypeDescription
spanner::Row