3.8.0-rc 3.7.0 (latest) 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 2.48.0-rc 2.47.1 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.1 2.24.0 2.23.0 2.22.1 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.1 2.14.0 2.13.0 2.12.0 2.11.0

## Classes

### [MockDataConnection](https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable__mocks_1_1MockDataConnection)

A class to mock [`google::cloud::bigtable::DataConnection`](https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable_1_1DataConnection).

## Functions

### MakeQueryRow(std::vector\< std::pair\< std::string, bigtable::Value \> \> const \&)

Creates a [`bigtable::QueryRow`](https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable_1_1QueryRow) 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 [`bigtable::Value`](https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable_1_1Value) that goes in each column.

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `columns` | `std::vector< std::pair< std::string, bigtable::Value > > const &` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bigtable::QueryRow` |   |

### MakeQueryRow(Ts \&\&...)

Creates a [`bigtable::QueryRow`](https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable_1_1QueryRow) with [`bigtable::Value`](https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable_1_1Value)s 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 [`bigtable::Value`](https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable_1_1Value)s 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::ReadRows` call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `values` | `Ts &&...` |
| `typename...` |   |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bigtable::QueryRow` |   |

### MakeRowReader(std::vector\< bigtable::Row \>, Status)

Returns a `RowReader` with a fixed output stream.
This factory function is offered for customers to mock the output of `Table::ReadRows(...)` in their tests.

> [!NOTE]
> **Note:** If `Cancel()` is called on the `RowReader`, the stream will terminate and return `final_status`.

    TEST(ReadRowsTest, Success) {
      using ::google::cloud::StatusOr;
      using cbt = ::google::cloud::bigtable;
      using cbtm = ::google::cloud::bigtable_mocks;

      std::vector<cbt::Row> rows = {cbt::Row("r1", {}), cbt::Row("r2", {})};

      auto mock = std::shared_ptr<cbtm::MockDataConnection>();
      EXPECT_CALL(*mock, ReadRowsFull)
          .WillOnce(Return(cbtm::MakeRowReader(rows)));

      auto table = cbt::Table(mock);
      auto reader = table.ReadRows(...);

      // Verify your code works when reading rows: {"r1", "r2"}
    }

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `rows` | `std::vector< bigtable::Row >` a vector containing the `Row`s returned by iterating over the `RowReader`. |
| `final_status` | `Status` the final [Status](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) of the stream. Defaults to OK. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bigtable::RowReader` |   |