Ejemplo n.º 1
0
        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 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();
        }
Ejemplo n.º 3
0
        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();
        }