public void MutateCustomInterests()
        {
            moq::Mock <CustomInterestService.CustomInterestServiceClient> mockGrpcClient = new moq::Mock <CustomInterestService.CustomInterestServiceClient>(moq::MockBehavior.Strict);
            MutateCustomInterestsRequest request = new MutateCustomInterestsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new CustomInterestOperation(),
                },
            };
            MutateCustomInterestsResponse expectedResponse = new MutateCustomInterestsResponse
            {
                Results =
                {
                    new MutateCustomInterestResult(),
                },
            };

            mockGrpcClient.Setup(x => x.MutateCustomInterests(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CustomInterestServiceClient   client   = new CustomInterestServiceClientImpl(mockGrpcClient.Object, null);
            MutateCustomInterestsResponse response = client.MutateCustomInterests(request.CustomerId, request.Operations);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task MutateCustomInterestsAsync()
        {
            moq::Mock <CustomInterestService.CustomInterestServiceClient> mockGrpcClient = new moq::Mock <CustomInterestService.CustomInterestServiceClient>(moq::MockBehavior.Strict);
            MutateCustomInterestsRequest request = new MutateCustomInterestsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new CustomInterestOperation(),
                },
            };
            MutateCustomInterestsResponse expectedResponse = new MutateCustomInterestsResponse
            {
                Results =
                {
                    new MutateCustomInterestResult(),
                },
            };

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

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

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for MutateCustomInterests</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateCustomInterestsRequestObject()
 {
     // Create client
     CustomInterestServiceClient customInterestServiceClient = CustomInterestServiceClient.Create();
     // Initialize request argument(s)
     MutateCustomInterestsRequest request = new MutateCustomInterestsRequest
     {
         CustomerId = "",
         Operations =
         {
             new CustomInterestOperation(),
         },
         ValidateOnly = false,
     };
     // Make the request
     MutateCustomInterestsResponse response = customInterestServiceClient.MutateCustomInterests(request);
 }
        /// <summary>Snippet for MutateCustomInterestsAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task MutateCustomInterestsRequestObjectAsync()
        {
            // Create client
            CustomInterestServiceClient customInterestServiceClient = await CustomInterestServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateCustomInterestsRequest request = new MutateCustomInterestsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new CustomInterestOperation(),
                },
                ValidateOnly = false,
            };
            // Make the request
            MutateCustomInterestsResponse response = await customInterestServiceClient.MutateCustomInterestsAsync(request);
        }
Exemplo n.º 5
0
        public async Task MutateCustomInterestsAsync3()
        {
            Mock <CustomInterestService.CustomInterestServiceClient> mockGrpcClient = new Mock <CustomInterestService.CustomInterestServiceClient>(MockBehavior.Strict);
            MutateCustomInterestsRequest request = new MutateCustomInterestsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateCustomInterestsResponse expectedResponse = new MutateCustomInterestsResponse();

            mockGrpcClient.Setup(x => x.MutateCustomInterestsAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateCustomInterestsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            CustomInterestServiceClient   client   = new CustomInterestServiceClientImpl(mockGrpcClient.Object, null);
            MutateCustomInterestsResponse response = await client.MutateCustomInterestsAsync(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 6
0
        public void MutateCustomInterests3()
        {
            Mock <CustomInterestService.CustomInterestServiceClient> mockGrpcClient = new Mock <CustomInterestService.CustomInterestServiceClient>(MockBehavior.Strict);
            MutateCustomInterestsRequest request = new MutateCustomInterestsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateCustomInterestsResponse expectedResponse = new MutateCustomInterestsResponse();

            mockGrpcClient.Setup(x => x.MutateCustomInterests(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CustomInterestServiceClient   client   = new CustomInterestServiceClientImpl(mockGrpcClient.Object, null);
            MutateCustomInterestsResponse response = client.MutateCustomInterests(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        /// <summary>Snippet for MutateCustomInterestsAsync</summary>
        public async Task MutateCustomInterestsRequestObjectAsync()
        {
            // Snippet: MutateCustomInterestsAsync(MutateCustomInterestsRequest, CallSettings)
            // Additional: MutateCustomInterestsAsync(MutateCustomInterestsRequest, CancellationToken)
            // Create client
            CustomInterestServiceClient customInterestServiceClient = await CustomInterestServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateCustomInterestsRequest request = new MutateCustomInterestsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new CustomInterestOperation(),
                },
                ValidateOnly = false,
            };
            // Make the request
            MutateCustomInterestsResponse response = await customInterestServiceClient.MutateCustomInterestsAsync(request);

            // End snippet
        }
Exemplo n.º 8
0
        public void MutateCustomInterests()
        {
            Mock <CustomInterestService.CustomInterestServiceClient> mockGrpcClient = new Mock <CustomInterestService.CustomInterestServiceClient>(MockBehavior.Strict);
            MutateCustomInterestsRequest expectedRequest = new MutateCustomInterestsRequest
            {
                CustomerId   = "customerId-1772061412",
                Operations   = { },
                ValidateOnly = false,
            };
            MutateCustomInterestsResponse expectedResponse = new MutateCustomInterestsResponse();

            mockGrpcClient.Setup(x => x.MutateCustomInterests(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CustomInterestServiceClient client = new CustomInterestServiceClientImpl(mockGrpcClient.Object, null);
            string customerId = "customerId-1772061412";
            IEnumerable <CustomInterestOperation> operations = new List <CustomInterestOperation>();
            bool validateOnly = false;
            MutateCustomInterestsResponse response = client.MutateCustomInterests(customerId, operations, validateOnly);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 9
0
 /// <summary>
 /// Creates or updates custom interests. 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 <MutateCustomInterestsResponse> MutateCustomInterestsAsync(MutateCustomInterestsRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_MutateCustomInterestsRequest(ref request, ref callSettings);
     return(_callMutateCustomInterests.Async(request, callSettings));
 }
Exemplo n.º 10
0
 partial void Modify_MutateCustomInterestsRequest(ref MutateCustomInterestsRequest request, ref gaxgrpc::CallSettings settings);
Exemplo n.º 11
0
 /// <summary>
 /// Creates or updates custom interests. 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 <MutateCustomInterestsResponse> MutateCustomInterestsAsync(MutateCustomInterestsRequest request, st::CancellationToken cancellationToken) =>
 MutateCustomInterestsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 12
0
 /// <summary>
 /// Creates or updates custom interests. 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 <MutateCustomInterestsResponse> MutateCustomInterestsAsync(MutateCustomInterestsRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();