/// <summary>Snippet for ListBrands</summary>
 public void ListBrandsRequestObject()
 {
     // Snippet: ListBrands(ListBrandsRequest, CallSettings)
     // Create client
     IdentityAwareProxyOAuthServiceClient identityAwareProxyOAuthServiceClient = IdentityAwareProxyOAuthServiceClient.Create();
     // Initialize request argument(s)
     ListBrandsRequest request = new ListBrandsRequest {
         Parent = "",
     };
     // Make the request
     ListBrandsResponse response = identityAwareProxyOAuthServiceClient.ListBrands(request);
     // End snippet
 }
        /// <summary>Snippet for ListBrandsAsync</summary>
        public async Task ListBrandsRequestObjectAsync()
        {
            // Snippet: ListBrandsAsync(ListBrandsRequest, CallSettings)
            // Additional: ListBrandsAsync(ListBrandsRequest, CancellationToken)
            // Create client
            IdentityAwareProxyOAuthServiceClient identityAwareProxyOAuthServiceClient = await IdentityAwareProxyOAuthServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListBrandsRequest request = new ListBrandsRequest {
                Parent = "",
            };
            // Make the request
            ListBrandsResponse response = await identityAwareProxyOAuthServiceClient.ListBrandsAsync(request);

            // End snippet
        }
Beispiel #3
0
        public void ListBrandsRequestObject()
        {
            moq::Mock <IdentityAwareProxyOAuthService.IdentityAwareProxyOAuthServiceClient> mockGrpcClient = new moq::Mock <IdentityAwareProxyOAuthService.IdentityAwareProxyOAuthServiceClient>(moq::MockBehavior.Strict);
            ListBrandsRequest request = new ListBrandsRequest
            {
                Parent = "parent7858e4d0",
            };
            ListBrandsResponse expectedResponse = new ListBrandsResponse
            {
                Brands = { new Brand(), },
            };

            mockGrpcClient.Setup(x => x.ListBrands(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            IdentityAwareProxyOAuthServiceClient client = new IdentityAwareProxyOAuthServiceClientImpl(mockGrpcClient.Object, null);
            ListBrandsResponse response = client.ListBrands(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #4
0
        public async stt::Task ListBrandsRequestObjectAsync()
        {
            moq::Mock <IdentityAwareProxyOAuthService.IdentityAwareProxyOAuthServiceClient> mockGrpcClient = new moq::Mock <IdentityAwareProxyOAuthService.IdentityAwareProxyOAuthServiceClient>(moq::MockBehavior.Strict);
            ListBrandsRequest request = new ListBrandsRequest
            {
                Parent = "parent7858e4d0",
            };
            ListBrandsResponse expectedResponse = new ListBrandsResponse
            {
                Brands = { new Brand(), },
            };

            mockGrpcClient.Setup(x => x.ListBrandsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ListBrandsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            IdentityAwareProxyOAuthServiceClient client = new IdentityAwareProxyOAuthServiceClientImpl(mockGrpcClient.Object, null);
            ListBrandsResponse responseCallSettings     = await client.ListBrandsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            ListBrandsResponse responseCancellationToken = await client.ListBrandsAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }