public async stt::Task MutateAdGroupFeedsAsync() { moq::Mock <AdGroupFeedService.AdGroupFeedServiceClient> mockGrpcClient = new moq::Mock <AdGroupFeedService.AdGroupFeedServiceClient>(moq::MockBehavior.Strict); MutateAdGroupFeedsRequest request = new MutateAdGroupFeedsRequest { CustomerId = "customer_id3b3724cb", Operations = { new AdGroupFeedOperation(), }, }; MutateAdGroupFeedsResponse expectedResponse = new MutateAdGroupFeedsResponse { Results = { new MutateAdGroupFeedResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateAdGroupFeedsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateAdGroupFeedsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AdGroupFeedServiceClient client = new AdGroupFeedServiceClientImpl(mockGrpcClient.Object, null); MutateAdGroupFeedsResponse responseCallSettings = await client.MutateAdGroupFeedsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); MutateAdGroupFeedsResponse responseCancellationToken = await client.MutateAdGroupFeedsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateAdGroupFeedsRequestObject() { moq::Mock <AdGroupFeedService.AdGroupFeedServiceClient> mockGrpcClient = new moq::Mock <AdGroupFeedService.AdGroupFeedServiceClient>(moq::MockBehavior.Strict); MutateAdGroupFeedsRequest request = new MutateAdGroupFeedsRequest { CustomerId = "customer_id3b3724cb", Operations = { new AdGroupFeedOperation(), }, PartialFailure = false, ValidateOnly = true, ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly, }; MutateAdGroupFeedsResponse expectedResponse = new MutateAdGroupFeedsResponse { Results = { new MutateAdGroupFeedResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateAdGroupFeeds(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AdGroupFeedServiceClient client = new AdGroupFeedServiceClientImpl(mockGrpcClient.Object, null); MutateAdGroupFeedsResponse response = client.MutateAdGroupFeeds(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateAdGroupFeeds() { moq::Mock <AdGroupFeedService.AdGroupFeedServiceClient> mockGrpcClient = new moq::Mock <AdGroupFeedService.AdGroupFeedServiceClient>(moq::MockBehavior.Strict); MutateAdGroupFeedsRequest request = new MutateAdGroupFeedsRequest { CustomerId = "customer_id3b3724cb", Operations = { new AdGroupFeedOperation(), }, }; MutateAdGroupFeedsResponse expectedResponse = new MutateAdGroupFeedsResponse { Results = { new MutateAdGroupFeedResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateAdGroupFeeds(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AdGroupFeedServiceClient client = new AdGroupFeedServiceClientImpl(mockGrpcClient.Object, null); MutateAdGroupFeedsResponse response = client.MutateAdGroupFeeds(request.CustomerId, request.Operations); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateAdGroupFeeds</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateAdGroupFeeds() { // Create client AdGroupFeedServiceClient adGroupFeedServiceClient = AdGroupFeedServiceClient.Create(); // Initialize request argument(s) string customerId = ""; IEnumerable <AdGroupFeedOperation> operations = new AdGroupFeedOperation[] { new AdGroupFeedOperation(), }; // Make the request MutateAdGroupFeedsResponse response = adGroupFeedServiceClient.MutateAdGroupFeeds(customerId, operations); }
/// <summary>Snippet for MutateAdGroupFeedsAsync</summary> public async Task MutateAdGroupFeedsAsync() { // Snippet: MutateAdGroupFeedsAsync(string, IEnumerable<AdGroupFeedOperation>, CallSettings) // Additional: MutateAdGroupFeedsAsync(string, IEnumerable<AdGroupFeedOperation>, CancellationToken) // Create client AdGroupFeedServiceClient adGroupFeedServiceClient = await AdGroupFeedServiceClient.CreateAsync(); // Initialize request argument(s) string customerId = ""; IEnumerable <AdGroupFeedOperation> operations = new AdGroupFeedOperation[] { new AdGroupFeedOperation(), }; // Make the request MutateAdGroupFeedsResponse response = await adGroupFeedServiceClient.MutateAdGroupFeedsAsync(customerId, operations); // End snippet }
public async Task MutateAdGroupFeedsAsync3() { Mock <AdGroupFeedService.AdGroupFeedServiceClient> mockGrpcClient = new Mock <AdGroupFeedService.AdGroupFeedServiceClient>(MockBehavior.Strict); MutateAdGroupFeedsRequest request = new MutateAdGroupFeedsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateAdGroupFeedsResponse expectedResponse = new MutateAdGroupFeedsResponse(); mockGrpcClient.Setup(x => x.MutateAdGroupFeedsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateAdGroupFeedsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); AdGroupFeedServiceClient client = new AdGroupFeedServiceClientImpl(mockGrpcClient.Object, null); MutateAdGroupFeedsResponse response = await client.MutateAdGroupFeedsAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateAdGroupFeeds3() { Mock <AdGroupFeedService.AdGroupFeedServiceClient> mockGrpcClient = new Mock <AdGroupFeedService.AdGroupFeedServiceClient>(MockBehavior.Strict); MutateAdGroupFeedsRequest request = new MutateAdGroupFeedsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateAdGroupFeedsResponse expectedResponse = new MutateAdGroupFeedsResponse(); mockGrpcClient.Setup(x => x.MutateAdGroupFeeds(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); AdGroupFeedServiceClient client = new AdGroupFeedServiceClientImpl(mockGrpcClient.Object, null); MutateAdGroupFeedsResponse response = client.MutateAdGroupFeeds(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateAdGroupFeeds</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateAdGroupFeedsRequestObject() { // Create client AdGroupFeedServiceClient adGroupFeedServiceClient = AdGroupFeedServiceClient.Create(); // Initialize request argument(s) MutateAdGroupFeedsRequest request = new MutateAdGroupFeedsRequest { CustomerId = "", Operations = { new AdGroupFeedOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateAdGroupFeedsResponse response = adGroupFeedServiceClient.MutateAdGroupFeeds(request); }
/// <summary>Snippet for MutateAdGroupFeedsAsync</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 MutateAdGroupFeedsRequestObjectAsync() { // Create client AdGroupFeedServiceClient adGroupFeedServiceClient = await AdGroupFeedServiceClient.CreateAsync(); // Initialize request argument(s) MutateAdGroupFeedsRequest request = new MutateAdGroupFeedsRequest { CustomerId = "", Operations = { new AdGroupFeedOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateAdGroupFeedsResponse response = await adGroupFeedServiceClient.MutateAdGroupFeedsAsync(request); }
/// <summary>Snippet for MutateAdGroupFeeds</summary> public void MutateAdGroupFeedsRequestObject() { // Snippet: MutateAdGroupFeeds(MutateAdGroupFeedsRequest, CallSettings) // Create client AdGroupFeedServiceClient adGroupFeedServiceClient = AdGroupFeedServiceClient.Create(); // Initialize request argument(s) MutateAdGroupFeedsRequest request = new MutateAdGroupFeedsRequest { CustomerId = "", Operations = { new AdGroupFeedOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateAdGroupFeedsResponse response = adGroupFeedServiceClient.MutateAdGroupFeeds(request); // End snippet }
/// <summary>Snippet for MutateAdGroupFeedsAsync</summary> public async Task MutateAdGroupFeedsRequestObjectAsync() { // Snippet: MutateAdGroupFeedsAsync(MutateAdGroupFeedsRequest, CallSettings) // Additional: MutateAdGroupFeedsAsync(MutateAdGroupFeedsRequest, CancellationToken) // Create client AdGroupFeedServiceClient adGroupFeedServiceClient = await AdGroupFeedServiceClient.CreateAsync(); // Initialize request argument(s) MutateAdGroupFeedsRequest request = new MutateAdGroupFeedsRequest { CustomerId = "", Operations = { new AdGroupFeedOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateAdGroupFeedsResponse response = await adGroupFeedServiceClient.MutateAdGroupFeedsAsync(request); // End snippet }
public async Task MutateAdGroupFeedsAsync() { Mock <AdGroupFeedService.AdGroupFeedServiceClient> mockGrpcClient = new Mock <AdGroupFeedService.AdGroupFeedServiceClient>(MockBehavior.Strict); MutateAdGroupFeedsRequest expectedRequest = new MutateAdGroupFeedsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateAdGroupFeedsResponse expectedResponse = new MutateAdGroupFeedsResponse(); mockGrpcClient.Setup(x => x.MutateAdGroupFeedsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateAdGroupFeedsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); AdGroupFeedServiceClient client = new AdGroupFeedServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <AdGroupFeedOperation> operations = new List <AdGroupFeedOperation>(); bool partialFailure = true; bool validateOnly = false; MutateAdGroupFeedsResponse response = await client.MutateAdGroupFeedsAsync(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }