public void MutateAdGroupAdLabels()
        {
            moq::Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new moq::Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(moq::MockBehavior.Strict);
            MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new AdGroupAdLabelOperation(),
                },
            };
            MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse
            {
                Results =
                {
                    new MutateAdGroupAdLabelResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateAdGroupAdLabels(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AdGroupAdLabelServiceClient   client   = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null);
            MutateAdGroupAdLabelsResponse response = client.MutateAdGroupAdLabels(request.CustomerId, request.Operations);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task MutateAdGroupAdLabelsAsync()
        {
            moq::Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new moq::Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(moq::MockBehavior.Strict);
            MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new AdGroupAdLabelOperation(),
                },
            };
            MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse
            {
                Results =
                {
                    new MutateAdGroupAdLabelResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateAdGroupAdLabelsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateAdGroupAdLabelsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AdGroupAdLabelServiceClient   client = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null);
            MutateAdGroupAdLabelsResponse responseCallSettings = await client.MutateAdGroupAdLabelsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            MutateAdGroupAdLabelsResponse responseCancellationToken = await client.MutateAdGroupAdLabelsAsync(request.CustomerId, request.Operations, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Пример #3
0
 /// <summary>Snippet for MutateAdGroupAdLabels</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateAdGroupAdLabels()
 {
     // Create client
     AdGroupAdLabelServiceClient adGroupAdLabelServiceClient = AdGroupAdLabelServiceClient.Create();
     // Initialize request argument(s)
     string customerId = "";
     IEnumerable <AdGroupAdLabelOperation> operations = new AdGroupAdLabelOperation[]
     {
         new AdGroupAdLabelOperation(),
     };
     // Make the request
     MutateAdGroupAdLabelsResponse response = adGroupAdLabelServiceClient.MutateAdGroupAdLabels(customerId, operations);
 }
Пример #4
0
 /// <summary>Snippet for MutateAdGroupAdLabelsAsync</summary>
 public async Task MutateAdGroupAdLabelsAsync()
 {
     // Snippet: MutateAdGroupAdLabelsAsync(string, IEnumerable<AdGroupAdLabelOperation>, CallSettings)
     // Additional: MutateAdGroupAdLabelsAsync(string, IEnumerable<AdGroupAdLabelOperation>, CancellationToken)
     // Create client
     AdGroupAdLabelServiceClient adGroupAdLabelServiceClient = await AdGroupAdLabelServiceClient.CreateAsync();
     // Initialize request argument(s)
     string customerId = "";
     IEnumerable<AdGroupAdLabelOperation> operations = new AdGroupAdLabelOperation[]
     {
         new AdGroupAdLabelOperation(),
     };
     // Make the request
     MutateAdGroupAdLabelsResponse response = await adGroupAdLabelServiceClient.MutateAdGroupAdLabelsAsync(customerId, operations);
     // End snippet
 }
Пример #5
0
        public async Task MutateAdGroupAdLabelsAsync3()
        {
            Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(MockBehavior.Strict);
            MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse();

            mockGrpcClient.Setup(x => x.MutateAdGroupAdLabelsAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateAdGroupAdLabelsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            AdGroupAdLabelServiceClient   client   = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null);
            MutateAdGroupAdLabelsResponse response = await client.MutateAdGroupAdLabelsAsync(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #6
0
        public void MutateAdGroupAdLabels3()
        {
            Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(MockBehavior.Strict);
            MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse();

            mockGrpcClient.Setup(x => x.MutateAdGroupAdLabels(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            AdGroupAdLabelServiceClient   client   = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null);
            MutateAdGroupAdLabelsResponse response = client.MutateAdGroupAdLabels(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #7
0
 /// <summary>Snippet for MutateAdGroupAdLabels</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateAdGroupAdLabelsRequestObject()
 {
     // Create client
     AdGroupAdLabelServiceClient adGroupAdLabelServiceClient = AdGroupAdLabelServiceClient.Create();
     // Initialize request argument(s)
     MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest
     {
         CustomerId = "",
         Operations =
         {
             new AdGroupAdLabelOperation(),
         },
         PartialFailure = false,
         ValidateOnly   = false,
     };
     // Make the request
     MutateAdGroupAdLabelsResponse response = adGroupAdLabelServiceClient.MutateAdGroupAdLabels(request);
 }
Пример #8
0
 /// <summary>Snippet for MutateAdGroupAdLabelsAsync</summary>
 public async Task MutateAdGroupAdLabelsRequestObjectAsync()
 {
     // Snippet: MutateAdGroupAdLabelsAsync(MutateAdGroupAdLabelsRequest, CallSettings)
     // Additional: MutateAdGroupAdLabelsAsync(MutateAdGroupAdLabelsRequest, CancellationToken)
     // Create client
     AdGroupAdLabelServiceClient adGroupAdLabelServiceClient = await AdGroupAdLabelServiceClient.CreateAsync();
     // Initialize request argument(s)
     MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest
     {
         CustomerId = "",
         Operations =
         {
             new AdGroupAdLabelOperation(),
         },
         PartialFailure = false,
         ValidateOnly = false,
     };
     // Make the request
     MutateAdGroupAdLabelsResponse response = await adGroupAdLabelServiceClient.MutateAdGroupAdLabelsAsync(request);
     // End snippet
 }
Пример #9
0
        public async Task MutateAdGroupAdLabelsAsync()
        {
            Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(MockBehavior.Strict);
            MutateAdGroupAdLabelsRequest expectedRequest = new MutateAdGroupAdLabelsRequest
            {
                CustomerId     = "customerId-1772061412",
                Operations     = { },
                PartialFailure = true,
                ValidateOnly   = false,
            };
            MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse();

            mockGrpcClient.Setup(x => x.MutateAdGroupAdLabelsAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateAdGroupAdLabelsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            AdGroupAdLabelServiceClient client = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null);
            string customerId = "customerId-1772061412";
            IEnumerable <AdGroupAdLabelOperation> operations = new List <AdGroupAdLabelOperation>();
            bool partialFailure = true;
            bool validateOnly   = false;
            MutateAdGroupAdLabelsResponse response = await client.MutateAdGroupAdLabelsAsync(customerId, operations, partialFailure, validateOnly);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }