public void MutateKeywordPlanCampaigns() { moq::Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(moq::MockBehavior.Strict); MutateKeywordPlanCampaignsRequest request = new MutateKeywordPlanCampaignsRequest { CustomerId = "customer_id3b3724cb", Operations = { new KeywordPlanCampaignOperation(), }, }; MutateKeywordPlanCampaignsResponse expectedResponse = new MutateKeywordPlanCampaignsResponse { Results = { new MutateKeywordPlanCampaignResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaigns(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanCampaignsResponse response = client.MutateKeywordPlanCampaigns(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateKeywordPlanCampaigns3() { Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(MockBehavior.Strict); MutateKeywordPlanCampaignsRequest request = new MutateKeywordPlanCampaignsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateKeywordPlanCampaignsResponse expectedResponse = new MutateKeywordPlanCampaignsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaigns(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanCampaignsResponse response = client.MutateKeywordPlanCampaigns(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateKeywordPlanCampaigns() { Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(MockBehavior.Strict); MutateKeywordPlanCampaignsRequest expectedRequest = new MutateKeywordPlanCampaignsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateKeywordPlanCampaignsResponse expectedResponse = new MutateKeywordPlanCampaignsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaigns(expectedRequest, It.IsAny <CallOptions>())) .Returns(expectedResponse); KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <KeywordPlanCampaignOperation> operations = new List <KeywordPlanCampaignOperation>(); bool partialFailure = true; bool validateOnly = false; MutateKeywordPlanCampaignsResponse response = client.MutateKeywordPlanCampaigns(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }