Пример #1
0
        public async stt::Task MutateKeywordPlansAsync()
        {
            moq::Mock <KeywordPlanService.KeywordPlanServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanService.KeywordPlanServiceClient>(moq::MockBehavior.Strict);
            MutateKeywordPlansRequest request = new MutateKeywordPlansRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new KeywordPlanOperation(),
                },
            };
            MutateKeywordPlansResponse expectedResponse = new MutateKeywordPlansResponse
            {
                Results =
                {
                    new MutateKeywordPlansResult(),
                },
                PartialFailureError = new gr::Status(),
            };

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

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

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Пример #2
0
        public void MutateKeywordPlans()
        {
            moq::Mock <KeywordPlanService.KeywordPlanServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanService.KeywordPlanServiceClient>(moq::MockBehavior.Strict);
            MutateKeywordPlansRequest request = new MutateKeywordPlansRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new KeywordPlanOperation(),
                },
            };
            MutateKeywordPlansResponse expectedResponse = new MutateKeywordPlansResponse
            {
                Results =
                {
                    new MutateKeywordPlansResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateKeywordPlans(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            KeywordPlanServiceClient   client   = new KeywordPlanServiceClientImpl(mockGrpcClient.Object, null);
            MutateKeywordPlansResponse response = client.MutateKeywordPlans(request.CustomerId, request.Operations);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #3
0
 /// <summary>Snippet for MutateKeywordPlans</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateKeywordPlansRequestObject()
 {
     // Create client
     KeywordPlanServiceClient keywordPlanServiceClient = KeywordPlanServiceClient.Create();
     // Initialize request argument(s)
     MutateKeywordPlansRequest request = new MutateKeywordPlansRequest
     {
         CustomerId = "",
         Operations =
         {
             new KeywordPlanOperation(),
         },
         PartialFailure = false,
         ValidateOnly   = false,
     };
     // Make the request
     MutateKeywordPlansResponse response = keywordPlanServiceClient.MutateKeywordPlans(request);
 }
        public async Task MutateKeywordPlansAsync3()
        {
            Mock <KeywordPlanService.KeywordPlanServiceClient> mockGrpcClient = new Mock <KeywordPlanService.KeywordPlanServiceClient>(MockBehavior.Strict);
            MutateKeywordPlansRequest request = new MutateKeywordPlansRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateKeywordPlansResponse expectedResponse = new MutateKeywordPlansResponse();

            mockGrpcClient.Setup(x => x.MutateKeywordPlansAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateKeywordPlansResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            KeywordPlanServiceClient   client   = new KeywordPlanServiceClientImpl(mockGrpcClient.Object, null);
            MutateKeywordPlansResponse response = await client.MutateKeywordPlansAsync(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateKeywordPlans3()
        {
            Mock <KeywordPlanService.KeywordPlanServiceClient> mockGrpcClient = new Mock <KeywordPlanService.KeywordPlanServiceClient>(MockBehavior.Strict);
            MutateKeywordPlansRequest request = new MutateKeywordPlansRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateKeywordPlansResponse expectedResponse = new MutateKeywordPlansResponse();

            mockGrpcClient.Setup(x => x.MutateKeywordPlans(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            KeywordPlanServiceClient   client   = new KeywordPlanServiceClientImpl(mockGrpcClient.Object, null);
            MutateKeywordPlansResponse response = client.MutateKeywordPlans(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #6
0
        /// <summary>Snippet for MutateKeywordPlansAsync</summary>
        public async Task MutateKeywordPlansRequestObjectAsync()
        {
            // Snippet: MutateKeywordPlansAsync(MutateKeywordPlansRequest, CallSettings)
            // Additional: MutateKeywordPlansAsync(MutateKeywordPlansRequest, CancellationToken)
            // Create client
            KeywordPlanServiceClient keywordPlanServiceClient = await KeywordPlanServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateKeywordPlansRequest request = new MutateKeywordPlansRequest
            {
                CustomerId = "",
                Operations =
                {
                    new KeywordPlanOperation(),
                },
                PartialFailure = false,
                ValidateOnly   = false,
            };
            // Make the request
            MutateKeywordPlansResponse response = await keywordPlanServiceClient.MutateKeywordPlansAsync(request);

            // End snippet
        }
        public async Task MutateKeywordPlansAsync()
        {
            Mock <KeywordPlanService.KeywordPlanServiceClient> mockGrpcClient = new Mock <KeywordPlanService.KeywordPlanServiceClient>(MockBehavior.Strict);
            MutateKeywordPlansRequest expectedRequest = new MutateKeywordPlansRequest
            {
                CustomerId     = "customerId-1772061412",
                Operations     = { },
                PartialFailure = true,
                ValidateOnly   = false,
            };
            MutateKeywordPlansResponse expectedResponse = new MutateKeywordPlansResponse();

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

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #8
0
 /// <summary>
 /// Creates, updates, or removes keyword plans. Operation statuses are
 /// returned.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override stt::Task <MutateKeywordPlansResponse> MutateKeywordPlansAsync(MutateKeywordPlansRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_MutateKeywordPlansRequest(ref request, ref callSettings);
     return(_callMutateKeywordPlans.Async(request, callSettings));
 }
Пример #9
0
 partial void Modify_MutateKeywordPlansRequest(ref MutateKeywordPlansRequest request, ref gaxgrpc::CallSettings settings);
Пример #10
0
 /// <summary>
 /// Creates, updates, or removes keyword plans. Operation statuses are
 /// returned.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <MutateKeywordPlansResponse> MutateKeywordPlansAsync(MutateKeywordPlansRequest request, st::CancellationToken cancellationToken) =>
 MutateKeywordPlansAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
Пример #11
0
 /// <summary>
 /// Creates, updates, or removes keyword plans. Operation statuses are
 /// returned.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <MutateKeywordPlansResponse> MutateKeywordPlansAsync(MutateKeywordPlansRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();