/*!

@page iam-mock Testing your Cloud IAM application with googlemock

This document describes how to test your own Cloud IAM application using
the Cloud IAM C++ client library, [Google Test][googletest-link] and the
[Google Test Mocking Framework][googlemock-link].

### Mocking a Successful IAMClient::GetServiceAccount() call

First include the headers for the Cloud IAM Client, the mocking class, and the
Google Mock framework:

@snippet mock_iam.cc required-includes

The example uses a number of aliases to save typing and improve readability:

@snippet mock_iam.cc helper-aliases

Create a mocking object for `google::cloud::iam_admin_v1::IAMConnection`:

@snippet mock_iam.cc create-mock

It is customary to first setup the expectations for your mock, and then
write the rest of the code:

@snippet mock_iam.cc setup-expectations

With the expectations in place, create a
`google::cloud::iam_admin_v1::IAMClient` object:

@snippet mock_iam.cc create-client

And then make calls on the client as usual:

@snippet mock_iam.cc client-call

And then verify the results meet your expectations:

@snippet mock_iam.cc expected-results

### Full Listing

Finally we present the full code for this example:

@snippet mock_iam.cc all

[googletest-link]: https://github.com/google/googletest
[googlemock-link]: https://github.com/google/googletest/tree/main/googlemock

*/
