A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud_1_1mocks below:

Namespace google::cloud::mocks (2.42.0-rc) | C++ Client Libraries

Namespace google::cloud::mocks (2.42.0-rc)

Stay organized with collections Save and categorize content based on your preferences.

Contains helpers for testing the Google Cloud C++ Client Libraries.

The symbols defined in this namespace are part of google-cloud-cpp's public API. Application developers may use them when mocking the client libraries in their own tests.

Classes MockAsyncStreamingReadWriteRpc<RequestType, ResponseType> Functions CurrentOptions()

Retrieve options used in a client call.

This would be used to verify configuration options from within a MockConnection. It provides a way for applications to test the difference between client.Foo(request, options) and client.Foo(request).

TEST(Foo, CallOptions) {
  auto mock = std::make_shared<MockConnection>();
  EXPECT_CALL(*mock, Foo).WillOnce([] {
        auto const& options = google::cloud::mocks::CurrentOptions();
        EXPECT_THAT(options, ...);
      });
  auto client = Client(mock);
  MyFunctionThatCallsFoo(client);
}
Returns Type Description Options const & MakeStreamRange(std::vector< T >, Status)

Construct a StreamRange<T> for use in tests.

auto sr = MakeStreamRange<T>({t1, t2});
for (StatusOr<T> const& t : sr) {
  // Yields t1 -> t2
}

sr = MakeStreamRange<T>({t1, t2}, BadStatus());
for (StatusOr<T> const& t : sr) {
  // Yields t1 -> t2 -> BadStatus()
}
Parameters Name Description values std::vector< T >

The successfully returned T values.

final_status Status

The final Status of the range. Defaults to an OK Status.

typename T
Returns Type Description StreamRange< T >

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-14 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["The latest version of the Google Cloud C++ Client Libraries testing helpers is 2.37.0-rc, with a list of previous versions available, ranging from 2.36.0 down to 2.10.1."],["This library provides mocking capabilities that application developers can use when testing client interactions within their own code."],["The `CurrentOptions()` function allows retrieval of options used in a client call, useful for verifying configurations in `MockConnection` tests."],["`MakeStreamRange()` enables the creation of `StreamRange` objects for testing, facilitating simulations of successful and error-containing data streams."],["The namespace contains helpers for testing, including a class for mocking async streaming read/write RPCs `MockAsyncStreamingReadWriteRpc\u003cRequestType, ResponseType\u003e`."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4