Exemplo n.º 1
0
        public void MutateKeywordPlanKeywords()
        {
            moq::Mock <KeywordPlanKeywordService.KeywordPlanKeywordServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanKeywordService.KeywordPlanKeywordServiceClient>(moq::MockBehavior.Strict);
            MutateKeywordPlanKeywordsRequest request = new MutateKeywordPlanKeywordsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new KeywordPlanKeywordOperation(),
                },
            };
            MutateKeywordPlanKeywordsResponse expectedResponse = new MutateKeywordPlanKeywordsResponse
            {
                Results =
                {
                    new MutateKeywordPlanKeywordResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateKeywordPlanKeywords(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            KeywordPlanKeywordServiceClient   client   = new KeywordPlanKeywordServiceClientImpl(mockGrpcClient.Object, null);
            MutateKeywordPlanKeywordsResponse response = client.MutateKeywordPlanKeywords(request.CustomerId, request.Operations);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateKeywordPlanKeywords3()
        {
            Mock <KeywordPlanKeywordService.KeywordPlanKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanKeywordService.KeywordPlanKeywordServiceClient>(MockBehavior.Strict);
            MutateKeywordPlanKeywordsRequest request = new MutateKeywordPlanKeywordsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateKeywordPlanKeywordsResponse expectedResponse = new MutateKeywordPlanKeywordsResponse();

            mockGrpcClient.Setup(x => x.MutateKeywordPlanKeywords(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            KeywordPlanKeywordServiceClient   client   = new KeywordPlanKeywordServiceClientImpl(mockGrpcClient.Object, null);
            MutateKeywordPlanKeywordsResponse response = client.MutateKeywordPlanKeywords(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateKeywordPlanKeywords()
        {
            Mock <KeywordPlanKeywordService.KeywordPlanKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanKeywordService.KeywordPlanKeywordServiceClient>(MockBehavior.Strict);
            MutateKeywordPlanKeywordsRequest expectedRequest = new MutateKeywordPlanKeywordsRequest
            {
                CustomerId     = "customerId-1772061412",
                Operations     = { },
                PartialFailure = true,
                ValidateOnly   = false,
            };
            MutateKeywordPlanKeywordsResponse expectedResponse = new MutateKeywordPlanKeywordsResponse();

            mockGrpcClient.Setup(x => x.MutateKeywordPlanKeywords(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            KeywordPlanKeywordServiceClient client = new KeywordPlanKeywordServiceClientImpl(mockGrpcClient.Object, null);
            string customerId = "customerId-1772061412";
            IEnumerable <KeywordPlanKeywordOperation> operations = new List <KeywordPlanKeywordOperation>();
            bool partialFailure = true;
            bool validateOnly   = false;
            MutateKeywordPlanKeywordsResponse response = client.MutateKeywordPlanKeywords(customerId, operations, partialFailure, validateOnly);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }