public async stt::Task GetKeywordPlanNegativeKeywordRequestObjectAsync() { moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(moq::MockBehavior.Strict); GetKeywordPlanNegativeKeywordRequest request = new GetKeywordPlanNegativeKeywordRequest { ResourceNameAsKeywordPlanNegativeKeywordName = gagvr::KeywordPlanNegativeKeywordName.FromCustomerKeywordPlanNegativeKeyword("[CUSTOMER]", "[KEYWORD_PLAN_NEGATIVE_KEYWORD]"), }; gagvr::KeywordPlanNegativeKeyword expectedResponse = new gagvr::KeywordPlanNegativeKeyword { ResourceNameAsKeywordPlanNegativeKeywordName = gagvr::KeywordPlanNegativeKeywordName.FromCustomerKeywordPlanNegativeKeyword("[CUSTOMER]", "[KEYWORD_PLAN_NEGATIVE_KEYWORD]"), KeywordPlanCampaignAsKeywordPlanCampaignName = gagvr::KeywordPlanCampaignName.FromCustomerKeywordPlanCampaign("[CUSTOMER]", "[KEYWORD_PLAN_CAMPAIGN]"), Id = -6774108720365892680L, Text = "textec51b21c", MatchType = gagve::KeywordMatchTypeEnum.Types.KeywordMatchType.Unspecified, }; mockGrpcClient.Setup(x => x.GetKeywordPlanNegativeKeywordAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <gagvr::KeywordPlanNegativeKeyword>(stt::Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null); gagvr::KeywordPlanNegativeKeyword responseCallSettings = await client.GetKeywordPlanNegativeKeywordAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); gagvr::KeywordPlanNegativeKeyword responseCancellationToken = await client.GetKeywordPlanNegativeKeywordAsync(request, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateKeywordPlanNegativeKeywords() { moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(moq::MockBehavior.Strict); MutateKeywordPlanNegativeKeywordsRequest request = new MutateKeywordPlanNegativeKeywordsRequest { CustomerId = "customer_id3b3724cb", Operations = { new KeywordPlanNegativeKeywordOperation(), }, }; MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse { Results = { new MutateKeywordPlanNegativeKeywordResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateKeywordPlanNegativeKeywords(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanNegativeKeywordsResponse response = client.MutateKeywordPlanNegativeKeywords(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task MutateKeywordPlanNegativeKeywordsAsync() { moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(moq::MockBehavior.Strict); MutateKeywordPlanNegativeKeywordsRequest request = new MutateKeywordPlanNegativeKeywordsRequest { CustomerId = "customer_id3b3724cb", Operations = { new KeywordPlanNegativeKeywordOperation(), }, }; MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse { Results = { new MutateKeywordPlanNegativeKeywordResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateKeywordPlanNegativeKeywordsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateKeywordPlanNegativeKeywordsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanNegativeKeywordsResponse responseCallSettings = await client.MutateKeywordPlanNegativeKeywordsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); MutateKeywordPlanNegativeKeywordsResponse responseCancellationToken = await client.MutateKeywordPlanNegativeKeywordsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public async Task MutateKeywordPlanNegativeKeywordsAsync3() { Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(MockBehavior.Strict); MutateKeywordPlanNegativeKeywordsRequest request = new MutateKeywordPlanNegativeKeywordsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanNegativeKeywordsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateKeywordPlanNegativeKeywordsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanNegativeKeywordsResponse response = await client.MutateKeywordPlanNegativeKeywordsAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateKeywordPlanNegativeKeywords3() { Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(MockBehavior.Strict); MutateKeywordPlanNegativeKeywordsRequest request = new MutateKeywordPlanNegativeKeywordsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanNegativeKeywords(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanNegativeKeywordsResponse response = client.MutateKeywordPlanNegativeKeywords(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetKeywordPlanNegativeKeyword2() { Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(MockBehavior.Strict); GetKeywordPlanNegativeKeywordRequest request = new GetKeywordPlanNegativeKeywordRequest { ResourceName = new KeywordPlanNegativeKeywordName("[CUSTOMER]", "[KEYWORD_PLAN_NEGATIVE_KEYWORD]").ToString(), }; KeywordPlanNegativeKeyword expectedResponse = new KeywordPlanNegativeKeyword { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetKeywordPlanNegativeKeyword(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null); KeywordPlanNegativeKeyword response = client.GetKeywordPlanNegativeKeyword(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task GetKeywordPlanNegativeKeywordAsync() { Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(MockBehavior.Strict); GetKeywordPlanNegativeKeywordRequest expectedRequest = new GetKeywordPlanNegativeKeywordRequest { ResourceName = new KeywordPlanNegativeKeywordName("[CUSTOMER]", "[KEYWORD_PLAN_NEGATIVE_KEYWORD]").ToString(), }; KeywordPlanNegativeKeyword expectedResponse = new KeywordPlanNegativeKeyword { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetKeywordPlanNegativeKeywordAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <KeywordPlanNegativeKeyword>(Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null); string formattedResourceName = new KeywordPlanNegativeKeywordName("[CUSTOMER]", "[KEYWORD_PLAN_NEGATIVE_KEYWORD]").ToString(); KeywordPlanNegativeKeyword response = await client.GetKeywordPlanNegativeKeywordAsync(formattedResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetKeywordPlanNegativeKeyword() { moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(moq::MockBehavior.Strict); GetKeywordPlanNegativeKeywordRequest request = new GetKeywordPlanNegativeKeywordRequest { ResourceNameAsKeywordPlanNegativeKeywordName = gagvr::KeywordPlanNegativeKeywordName.FromCustomerKeywordPlanNegativeKeyword("[CUSTOMER]", "[KEYWORD_PLAN_NEGATIVE_KEYWORD]"), }; gagvr::KeywordPlanNegativeKeyword expectedResponse = new gagvr::KeywordPlanNegativeKeyword { ResourceNameAsKeywordPlanNegativeKeywordName = gagvr::KeywordPlanNegativeKeywordName.FromCustomerKeywordPlanNegativeKeyword("[CUSTOMER]", "[KEYWORD_PLAN_NEGATIVE_KEYWORD]"), KeywordPlanCampaignAsKeywordPlanCampaignName = gagvr::KeywordPlanCampaignName.FromCustomerKeywordPlanCampaign("[CUSTOMER]", "[KEYWORD_PLAN_CAMPAIGN]"), Id = -6774108720365892680L, Text = "textec51b21c", MatchType = gagve::KeywordMatchTypeEnum.Types.KeywordMatchType.Unspecified, }; mockGrpcClient.Setup(x => x.GetKeywordPlanNegativeKeyword(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null); gagvr::KeywordPlanNegativeKeyword response = client.GetKeywordPlanNegativeKeyword(request.ResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task MutateKeywordPlanNegativeKeywordsAsync() { Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(MockBehavior.Strict); MutateKeywordPlanNegativeKeywordsRequest expectedRequest = new MutateKeywordPlanNegativeKeywordsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanNegativeKeywordsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateKeywordPlanNegativeKeywordsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <KeywordPlanNegativeKeywordOperation> operations = new List <KeywordPlanNegativeKeywordOperation>(); bool partialFailure = true; bool validateOnly = false; MutateKeywordPlanNegativeKeywordsResponse response = await client.MutateKeywordPlanNegativeKeywordsAsync(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }