1 // Copyright 2020 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #include "generator/integration_tests/golden/connection_options.gcpcxx.pb.h"
16 #include <gmock/gmock.h>
17 #include <memory>
18
19 namespace google {
20 namespace cloud {
21 namespace golden {
22 inline namespace GOOGLE_CLOUD_CPP_NS {
23 namespace {
24
25 using ::testing::HasSubstr;
26 using ::google::cloud::version_string;
27
TEST(GoldenConnectionOptionsTest,DefaultEndpoint)28 TEST(GoldenConnectionOptionsTest, DefaultEndpoint) {
29 ConnectionOptions options;
30 EXPECT_EQ("test.googleapis.com", options.endpoint());
31 }
32
TEST(GoldenConnectionOptionsTest,UserAgentPrefix)33 TEST(GoldenConnectionOptionsTest, UserAgentPrefix) {
34 ConnectionOptions options;
35 EXPECT_THAT(options.user_agent_prefix(), HasSubstr("gcloud-cpp/" + version_string()));
36 }
37
TEST(GoldenConnectionOptionsTest,DefaultNumChannels)38 TEST(GoldenConnectionOptionsTest, DefaultNumChannels) {
39 ConnectionOptions options;
40 EXPECT_EQ(4, options.num_channels());
41 }
42
43 } // namespace
44 } // namespace GOOGLE_CLOUD_CPP_NS
45 } // namespace golden
46 } // namespace cloud
47 } // namespace google
48