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();
        }
        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();
        }
 /// <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 MutateCustomInterests()
 {
     // Create client
     CustomInterestServiceClient customInterestServiceClient = CustomInterestServiceClient.Create();
     // Initialize request argument(s)
     string customerId = "";
     IEnumerable <CustomInterestOperation> operations = new CustomInterestOperation[]
     {
         new CustomInterestOperation(),
     };
     // Make the request
     MutateCustomInterestsResponse response = customInterestServiceClient.MutateCustomInterests(customerId, operations);
 }
 /// <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>
        public async Task MutateCustomInterestsAsync()
        {
            // Snippet: MutateCustomInterestsAsync(string, IEnumerable<CustomInterestOperation>, CallSettings)
            // Additional: MutateCustomInterestsAsync(string, IEnumerable<CustomInterestOperation>, CancellationToken)
            // Create client
            CustomInterestServiceClient customInterestServiceClient = await CustomInterestServiceClient.CreateAsync();

            // Initialize request argument(s)
            string customerId = "";
            IEnumerable <CustomInterestOperation> operations = new CustomInterestOperation[]
            {
                new CustomInterestOperation(),
            };
            // Make the request
            MutateCustomInterestsResponse response = await customInterestServiceClient.MutateCustomInterestsAsync(customerId, operations);

            // End snippet
        }
        /// <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);
        }
示例#7
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();
        }
示例#8
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
        }
示例#10
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();
        }