Ejemplo n.º 1
0
        public void MutateSmartCampaignSettings()
        {
            moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient> mockGrpcClient = new moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient>(moq::MockBehavior.Strict);
            MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new SmartCampaignSettingOperation(),
                },
            };
            MutateSmartCampaignSettingsResponse expectedResponse = new MutateSmartCampaignSettingsResponse
            {
                PartialFailureError = new gr::Status(),
                Results             =
                {
                    new MutateSmartCampaignSettingResult(),
                },
            };

            mockGrpcClient.Setup(x => x.MutateSmartCampaignSettings(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            SmartCampaignSettingServiceClient   client   = new SmartCampaignSettingServiceClientImpl(mockGrpcClient.Object, null);
            MutateSmartCampaignSettingsResponse response = client.MutateSmartCampaignSettings(request.CustomerId, request.Operations);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 2
0
        public async stt::Task MutateSmartCampaignSettingsRequestObjectAsync()
        {
            moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient> mockGrpcClient = new moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient>(moq::MockBehavior.Strict);
            MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new SmartCampaignSettingOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = true,
                ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly,
            };
            MutateSmartCampaignSettingsResponse expectedResponse = new MutateSmartCampaignSettingsResponse
            {
                PartialFailureError = new gr::Status(),
                Results             =
                {
                    new MutateSmartCampaignSettingResult(),
                },
            };

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

            Assert.AreEqual(expectedResponse, responseCallSettings);
            MutateSmartCampaignSettingsResponse responseCancellationToken = await client.MutateSmartCampaignSettingsAsync(request, st::CancellationToken.None);

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void MutateSmartCampaignSettingsRequestObject()
        {
            moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient> mockGrpcClient = new moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient>(moq::MockBehavior.Strict);
            MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new SmartCampaignSettingOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = true,
                ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly,
            };
            MutateSmartCampaignSettingsResponse expectedResponse = new MutateSmartCampaignSettingsResponse
            {
                PartialFailureError = new gr::Status(),
                Results             =
                {
                    new MutateSmartCampaignSettingResult(),
                },
            };

            mockGrpcClient.Setup(x => x.MutateSmartCampaignSettings(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            SmartCampaignSettingServiceClient   client   = new SmartCampaignSettingServiceClientImpl(mockGrpcClient.Object, null);
            MutateSmartCampaignSettingsResponse response = client.MutateSmartCampaignSettings(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for MutateSmartCampaignSettings</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateSmartCampaignSettings()
 {
     // Create client
     SmartCampaignSettingServiceClient smartCampaignSettingServiceClient = SmartCampaignSettingServiceClient.Create();
     // Initialize request argument(s)
     string customerId = "";
     IEnumerable <SmartCampaignSettingOperation> operations = new SmartCampaignSettingOperation[]
     {
         new SmartCampaignSettingOperation(),
     };
     // Make the request
     MutateSmartCampaignSettingsResponse response = smartCampaignSettingServiceClient.MutateSmartCampaignSettings(customerId, operations);
 }
Ejemplo n.º 5
0
        /// <summary>Snippet for MutateSmartCampaignSettingsAsync</summary>
        public async Task MutateSmartCampaignSettingsAsync()
        {
            // Snippet: MutateSmartCampaignSettingsAsync(string, IEnumerable<SmartCampaignSettingOperation>, CallSettings)
            // Additional: MutateSmartCampaignSettingsAsync(string, IEnumerable<SmartCampaignSettingOperation>, CancellationToken)
            // Create client
            SmartCampaignSettingServiceClient smartCampaignSettingServiceClient = await SmartCampaignSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            string customerId = "";
            IEnumerable <SmartCampaignSettingOperation> operations = new SmartCampaignSettingOperation[]
            {
                new SmartCampaignSettingOperation(),
            };
            // Make the request
            MutateSmartCampaignSettingsResponse response = await smartCampaignSettingServiceClient.MutateSmartCampaignSettingsAsync(customerId, operations);

            // End snippet
        }
 /// <summary>Snippet for MutateSmartCampaignSettings</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateSmartCampaignSettingsRequestObject()
 {
     // Create client
     SmartCampaignSettingServiceClient smartCampaignSettingServiceClient = SmartCampaignSettingServiceClient.Create();
     // Initialize request argument(s)
     MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
     {
         CustomerId = "",
         Operations =
         {
             new SmartCampaignSettingOperation(),
         },
         PartialFailure      = false,
         ValidateOnly        = false,
         ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
     };
     // Make the request
     MutateSmartCampaignSettingsResponse response = smartCampaignSettingServiceClient.MutateSmartCampaignSettings(request);
 }
Ejemplo n.º 7
0
        /// <summary>Snippet for MutateSmartCampaignSettingsAsync</summary>
        public async Task MutateSmartCampaignSettingsRequestObjectAsync()
        {
            // Snippet: MutateSmartCampaignSettingsAsync(MutateSmartCampaignSettingsRequest, CallSettings)
            // Additional: MutateSmartCampaignSettingsAsync(MutateSmartCampaignSettingsRequest, CancellationToken)
            // Create client
            SmartCampaignSettingServiceClient smartCampaignSettingServiceClient = await SmartCampaignSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new SmartCampaignSettingOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = false,
                ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
            };
            // Make the request
            MutateSmartCampaignSettingsResponse response = await smartCampaignSettingServiceClient.MutateSmartCampaignSettingsAsync(request);

            // End snippet
        }